Summary: Use the Set-Variable cmdlet to create a ReadOnly Windows PowerShell variable.
How can I create a ReadOnly variable in Windows PowerShell?
Use the Set-Variable cmdlet to create a ReadOnly variable, and specify ReadOnly for the Option parameter, and you can specify a description for the variable:
Set-Variable -Name myvariable -Value “value” -Description “mred variable” -Option readonly
0 comments