Powershell 2.0 inline script does not support passing arguments
See original GitHub issueThe File Path
-based script allows passing in arguments:
The Inline
one does not, however:
This significantly reduces its usefulness when used in task groups that can automatically discover configurable inputs from arguments used in a script.
Relevant PR: https://github.com/Microsoft/vsts-tasks/pull/4578
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Powershell 2.0 inline script does not support passing arguments
The File Path-based script allows passing in arguments: The Inline one does not, however: This significantly reduces its usefulness when ...
Read more >PowerShell 2.0 and "The term 'Param' is not recognized as the ...
I receive the following error: The term 'Param' is not recognized as the name of a cmdlet, function, script file, or operable program....
Read more >How-to: Pass parameters to a PowerShell script. - SS64
Pass arguments to a script or cmdlet by separating them with spaces: PS C:\> Get-ChildItem -Path $env:windir -Filter *.dll -Recurse. This can be...
Read more >Functions - PowerShell | Microsoft Learn
PowerShell functions allow you to create tools that can be reused in scripts. ... Don't hardcode values; use parameters and variables.
Read more >python run powershell script with arguments - You.com
and specifying the arguments as a sequence rather than a string is the recommended option. When running a script, it needs to be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The reason they are different is because you can simply put the variables in the inline script which should be a lot simpler than dealing with arguments. In the case of the file you have no option to do that.
@chrisrpatterson
Alas, unless I am mistaken, this breaks ability to use data retrieved from
Azure Key Vault
task. Actually usinginline script
appears to break all capability to retrieve ANY secret variables.Azure Key Vault
task to pull down a vault.powershell
/batch
/shell
task using inline option - unable to extract the Key vault data pulled down.No results: