Altiris powershell push
I am attempting to run a powershell script from altiris and having a problem
First I created a script to change the execution policy for powershell to unrestricted and verified this one works
I then created the following script. I didnt want to make it this noisey but other iterations didnt work.
$name = Get-WmiObject Win32_ComputerSystem
$Cname = $name.name
New-PSDrive -Name Z -PSProvider FileSystem -Root \\unc\path
get-service | ft name | Out-File Z:\"$Cname".txt
When I run the commands directly or as a .ps1 on the server it works as expected. When I run it from altiris i get a text file named .txt that is blank but all results in altiris come back success. Any ideas?