Forum Discussion
John Andrews
Nov 04, 2021Copper Contributor
Run Script from SCCM
I am a novice at PowerShell. I have a request to run a script from SCCM to install a list of printer drivers. Script is as follows... # Ricoh Universal Print Driver Get-ChildItem "\\server\d$\Pr...
J Mymryk
Nov 05, 2021Copper Contributor
What is the command line you are using in your deployment? Are you using Start /wait to ensure the command stays open while the script runs?
James
John Andrews
Nov 05, 2021Copper Contributor
Thanks for the reply. I am just starting out with working in PowerShell.
This is the command line:
powershell.exe -executionpolicy bypass -file ".\Filename.ps1"
Where would the Start /wait go.
- J MymrykNov 05, 2021Copper ContributorFor details on how start works, from a command prompt run start /?
or: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/start
basically run @start /wait "Command line" <parameters>
This will keep the command window open until it completes.- John AndrewsNov 08, 2021Copper Contributor
Thanks again. So it would look something like this?
@start /wait powershell.exe -executionpolicy bypass -file ".\File.ps1"
- J MymrykNov 18, 2021Copper ContributorSorry I haven't been in the forum for a bit but yes that looks about right but remove .\ for the file as it may not determine the location correctly.