I want to be able to set a version number in a Powershell/CMD argument that is stored in a file.
So let's say i have a long powershell/cmd command that has this argument in it py -m non_important_script --file-version={*get value from file*}
How would i get the version number that is stored in a file called version.py with one row of text in it:
__version__ = "1.2.0"
Basically i don't want to update this argument manually every time. It would be nice if i could always paste the same command into Powershell/CMD and it would put in the version number on it's own.
So far i've tried this py -m non_important_script --file-version=(Select-String -Path .\version.py -Pattern "\d.\d.\d").Matches.Groups[0].value, but it doesn't work and gives this error from the non_important_script:
FATAL:
Error, specify only one positional argument unless "--run" is specified to
pass them to the compiled program execution.