I'm trying to create a Shortcut for a powershell script that uses [Environment]::UserName the shortcut will be started from the correct user I want to read from env variable.
%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe -NoLogo -ExecutionPolicy Bypass -noexit -File "C:\test\test.ps1"
This the target on the shortcut. How can I make Env variables work?
Thanks
[Environment]::UserNameused in your test.ps1 file? if so please show the file. I need more detail to help.