Home
> Powershell > [PS] Passing a string into a powershell script
[PS] Passing a string into a powershell script
1 2 3 4 5 6 7 |
#call out the paramenter and data type, in our case [string]. param( [string]$arg1 ) if ($arg1 -eq "revert") { 'do this' }else { 'do that' } write-host $arg1 #shows the string |
Usage example:
test.ps1 revert
Categories: Powershell
Comments (0)
Trackbacks (0)
Leave a comment
Trackback