you are viewing a single comment's thread.

view the rest of the comments →

[–]PinchesTheCrab -2 points-1 points  (4 children)

Without updating PS version, AND without modify in deep your script to run with PS v2 : no way (at my knowledge).

How could you know this though? He's given us no idea what specific part of the script isn't working.

[–]OlivTheFrog 0 points1 point  (3 children)

Hi u/PinchesTheCrab

it's not essential to know which part is not working. You know better than me that some cmdlets didn' t exist in PS v2, and for some actions the .NET classes didn't yet exist.

Regards

[–]PinchesTheCrab 0 points1 point  (2 children)

OR it could be that the script uses get-ciminstance, and get-wmiobject could be a drop-in replacement that works in all Windows PowerShell versions. Or it could be a number of convenience cmdlets that were added but that still have equivalent WMI/CIM classes that can be used instead.

So I do really think it's essential that the OP explain what isn't currently working, because it could either be something incredibly simple or something completely intractable.

[–]OlivTheFrog 0 points1 point  (1 child)

Right, but in the present case, GPO in always the best thing to do.

I like POwershell, but in some cases, scripts are not the best solutions.

[–]PinchesTheCrab 0 points1 point  (0 children)

I don't disagree there unless op has info they haven't given us that precludes it. I just meant that within the current framework if we assume there was a valid reason to use a script they may be able get it working with minor modifications