Path to my script is on UNC and contains a space. To run it from powershell windows I have to type:
& "\\domain.private\netlogon\Group Scripts\NirvanaRoleMembership.ps1"
as apparently, unlike every other command ever, "" isn't enough for the spaces...
I set it as a scheduled task and can't get this to work. Obviously if I use just "\\domain.private\netlogon\Group Scripts\NirvanaRoleMembership.ps1" I get a notepad process start (wtf guys?). I've then tried running powershell with the location and & location as the arguments, both of which do nothing.
The script maybe running but the same changes from the same account and computer do not take effect.
So, run the exact same command from powershell? Works
Run said command as scheduled task, nothing happens, says it ran, no changes that are expected...
I have set execution policy to bypass on the machine.
Why is this so complicated? I wrote a script, it works, why doesn't this "just work"??