Advertising a 64 bit Powershell script

Did you know that you can not use Advertisements to run a 64 bit Powershell script?

Example:

  • You create a package with no source files
  • You create a PowerShell script and place it in a location on the target computers.  Let’s say C:\PleaseRun\PowershellScript.ps1
  • You create a program that Starts In “C:\WINDOWS\system32\windowspowershell\v1.0” and the command line “powershell.exe -file C:\PleaseRun\PowershellScript.ps1”
  • You advertise the above and notice that when the advertisement runs you see Powershell32.exe in the task manager

At this point you are pulling your hair out and wondering if you are WINNING DUH, or losing.  Well, you are losing.  But don’t fear because there is a solution.

Create a TASK SEQUENCE!

  • Run a command line
  • Command line would read (if using the above example) C:\WINDOWS\system32\windowspowershell\v1.0″ and the command line “powershell.exe -file C:\PleaseRun\PowershellScript.ps1
  • Start in:  %windir%\System32\WindowsPowerShell\v1.0\
  • DISABLE 64-BIT FILE SYSTEM REDIRECTION

As my good friend Lu would say “viola”  (however, she really means is voila)

You are now WINNING DUH!  Good job.