I wrote this long ago and am trying to maintain it now. While this seems rather obvious, I'm sure that it isn't:
# Start_Script_08.ps1#Has been run for this script: Set-ExecutionPolicy Unrestricted# Copies WMI_08.ps1 into Env:Copy "\\fileserver\Scanner\0 AA Scanner\Scripts\WMI_08.ps1" "$($Env:Temp)"pauseImport-Module "$($Env:Temp)\WMI_08.ps1"pause
So, why would those pauses be there? If I comment them out the process never seems to run. The objective here is to run a script (WMI_08.ps1) on a workstation where the script resides on a file server. The process flow here is: - Run a .bat file, residing on the file server, as administrator: WMI_08.bat This runs a Powershell executionpolicy bypass command for the Start_Script_08.ps1 - The .bat file launches Start_Script_08.ps1 which also resides on the file server. - This copies the main script WMI_08.ps1 onto the workstation into Env and runs it. The script can be manually copied onto a workstation and run. But, the idea is to avoid manual operations by executing the preliminary scripts as above.
For now, I'd be happy to know what those pauses do and don't do. Questions like: Should one or both be commented out? That seems to not work.
could be to see the output of the previous command before it continues; comes in handy for debugging
it will sit there and say 'press any key to continue . . .'
aside from that, it does nothing
to be fully automated, remove both else it will sit there forever when it hits the first one