I\'m working on creating a script that will fire off performance counters and store them in a .csv file, rolling over when the file gets too big. Running the script from a p
Powershell.exe -windowstyle hidden -file C:\iis_test.ps1
But when you run this command, a CMD window will appear.
However, you can use VBscript instead
Set objShell = CreateObject("WScript.Shell")
objShell.Run "CMD /C START /B " & objShell.ExpandEnvironmentStrings("%SystemRoot%") & "\System32\WindowsPowerShell\v1.0\powershell.exe -file " & "YourScript.ps1", 0, False
Set objShell = Nothing
try this from a DOS/CMD shell:
powershell.exe -windowstyle hidden -file C:\iis_test.ps1