I am attempting to have a powershell script run as a shortcut to output some simple information to a text file.
I have created this one line script named ipscript.ps1
get-netipaddress -addressfamily IPv4 | format-table > $($env:userprofile + '\Desktop\info.txt')
Then I created a shortcut and modified the target in the shortcut.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File “C:\Software\ipscript.ps1”
After double clicking the shortcut nothing happens and no file is output. If I run the one line script by itself in powershell the file is created.
Can anyone point out to me what could be wrong and how I can resolve it? I thank you in advance.