I'd like to upgrade all non-server clients in our environment to PowerShell 4.0. It is a mix of Win7 and Win8.1 devices so I only want to target the Win7 machines that have version 2.0 or 3.0 installed. I've built a Package/Program to deploy the framework package and that is working. My next challenge is to query the correct set of machines on the network. Normally I'd create a WMI query and assign those devices to the collection the app is deployed to. In this case I can't seem to build a query that finds the machines.

Installed Executable is no good as there are only a dozen or so of the 300-400 machines that appear in that search. I haven't been able to used the Registry - Name query either to look for a specific key.

Any ideas or insight into how to do this would be appreciated. I've scoured Google and have yet to find a silver bullet.

Thanks. 

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0

for SCCM i would set a condition against the application deployment to check against the following reg key as this identifies PowerShell version

HKLM\Software\Microsoft\PowerShell\1\PowerShellEngine

there should be a string called Powershellversion

and you can set the condition to equal or less than 3.0

any machine running 4.0 would not be targeted this will allow you to deploy to a large collectionmachines but only those that have an older version would get the update package

Answered 09/29/2015 by: sparky86
Fourth Degree Brown Belt

  • Would you be setting the condition in a Task Sequence then since you are referring to the deployment?
  • What I am noticing is PCs with 4.0 installed still have the key from the prior version left over so I'm not sure I will be able to get an accurate list only looking for that one key and value.
Please log in to comment
0
Can you not better deploy the update via WSUS (SCCM or not)?
To select only workstations there are many ways: WMI and LDAP always are for sure.
In my envirorment we use a machine naming convention and we keep workstations in a separate IP range.

But a SCCM collection should already be build in.
Answered 09/30/2015 by: dedenker
Third Degree Black Belt

  • I haven't come across info on successfully deploying PowerShell via WSUS. WMI is how I'd normally query machines that need the update, but I haven't been able to locate a place on our machines that consistently shows the presence of PowerShell and its version that WMI reports on. I think I may have found a way buy building it as an Application in SCCM and setting a requirement based on OS and a Detection Method that looks for a PowerShellEngine value of 4.0. If the value does not exist and it's a Win7 machine, the app installs.

    My problem now is that Software Center is sent a 3010 error code which signifies a passive reboot is required and is reporting the installation as a failure even though it was successful pending the reboot.
    • Try these two:
      -> http://www.nowmicro.com/deploying-windows-management-framework-4-with-configmgr/

      -> http://www.jonathanmedd.net/2013/10/windows-management-framework-powershell-4-0-is-now-available-ensure-you-already-have-net-4-5.html
      • Those are great write ups. Thank you for the link. Unfortunately, I still receive a 3010 error code and the Application shows failed in Software Center even after repairing .NET 4.5.2 which is already installed on 99% of our clients. I am deploying WMF 4.0 exactly how they are in the blog post but they don't seem to mention having the same issue I am.
      • I think my detection method is what is flagging it as a Failure. The detection method is calling $PSVersionTable looking for a value of 4.0 to be true, since the PC has not rebooted and applied the updates, the version is still listed as 2.0 and considers it to be a failure. The thing is, after rebooting and applying the update, it still reports it as a failure. I need to find where Windows is holding the 4.0 files before it applies them and use one that sticks around as the Detection method. At least that is the theory as of now..
Please log in to comment
This content is currently hidden from public view.
Reason: Removed by member request
For more information, visit our FAQ's.

Answer this question or Comment on this question for clarity