Forum Discussion
Luke_Gilmore
Jul 19, 2021Copper Contributor
Commands dont display output when ran in a script
Hi Everyone
I have put togeather a few commands to carry out a maciene survey.
Each line of code works fine when you run it individually, however when it runs in a script it dosnt output properaly.
Any ideas
- II was able to resolve this issue.
It works fine once i piped the output using format table instead of select object
- What is the result of Get-ExecutionPolicy?
- Luke_GilmoreCopper Contributor
- Try to run your .ps1 with an unrestricted execution policy like this
PowerShell.exe -ExecutionPolicy UnRestricted -File .\script.ps1
and see if you got the intended output.