Link to home
Start Free TrialLog in
Avatar of AXISHK
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}
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AXISHK
AXISHK

ASKER

Tks