AXISHK
asked on
Pass file as parameter to powershell script
Is it possible to pass a file to a powershell script as parameter, so that I will run the script as below ? Tks
.\myshut.ps1 List1.csv
Import-CSV .\computer1.csv | ForEach-Object{
stop-computer -Computer $_.Name -Force -ErrorAction silentlycontinue}
.\myshut.ps1 List1.csv
Import-CSV .\computer1.csv | ForEach-Object{
stop-computer -Computer $_.Name -Force -ErrorAction silentlycontinue}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER