Saturday, 1 September 2012

MED-V - Powershell script as program puslished to Windows 7 Start Menu

If you ever tried to make a Powershell script available in Windows 7 through MED-V you know that it won't show up in the start menu.

In my case the Powershell script is mapping some drives, copying some files and then running an application that's incompatible with Windows 7.

The solution in this case is to edit the shortcut and use the command prompt to run powershell.

So the target of the shortcut would be:

cmd /k "C:\Windows\System32\WindowsPowershell\v1.0\powershell.exe -noprofile -windowstyle hidden -executionpolicy bypass -file "C:\Folder\Script.ps1""

Use /c instead of /k if you want the command prompt disposed after it runs powershell.

No comments:

Post a Comment