Hope to get help in here. I’ll make a shortcut in the powershell deployment toolkit that points to a powershell script. I don’t get it right when I set execution policy bypass. I want it to be like this in the shortcut that is created:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "\SERVERNAME\Program\Viva\VivaUpdate_Basic__IBM-map-PS.ps1"
But not with “SERVERNAME”. I’ll replace that later. Don’t want to print with this in here. The string I put in the Deployment script is this line:
New-Shortcut -Path “$envProgramData\Microsoft\Windows\Start Menu\Programs\Viva\Viva.lnk” -TargetPath “C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File” ‘"\SERVERNAME\Program\Viva\VivaUpdate_Basic__IBM-map-PS.ps1"’ -IconLocation “$dirfiles\Update_Shortcut\Viva_icon.ico” -Description ‘Viva’ -WorkingDirectory "\SERVERNAME\Program\Viva"
What happens then is that it puts double “” in front of the path to powershell. Here’s what it looks like in the shortcut created by the Deploymet toolkit script:
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File" "\SERVERNAME\Program\Viva\VivaUpdate_Basic__IBM-map-PS.ps1"
So before "C:\ this is created and after Bypass -File". This can not be included, then it may not work. Does anyone have a string that works where it excludes these double " "?
I have tried to remove and replace a bit in the Deploy script. But nothing seems to work.
Grateful for answers