Reputation: 2118
I am using Set-ItemProperty to set a registry key in a new PS script that I am writing. Since the script can run on different PS versions, I am wondering if the cmdlet could have problems with any specific PS version.
So my question is, does the cmdlet Set-ItemProperty has any dependency on the PS version.
Upvotes: 0
Views: 449
Reputation: 354614
The cmdlet exists since PowerShell v1 and as far as I know its semantics didn't change since then.
If you use features that are only available in later versions, you can use a #requires
comment at the start of your script, e.g.:
#Requires -Version 3.0
Upvotes: 1