質問

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.

役に立ちましたか?

解決

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
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top