August 22nd, 2014

PowerTip: Mini-Scripting Games 2014 Answer 5

Doctor Scripto
Scripter

Summary: Here is the answer to the final question in Mini-Scripting Games 2014.

Hey, Scripting Guy! Question You created a constant variable in your Windows PowerShell console. Now, when you attempt to delete the variable,
           you get an error message. How can you remove a constant variable?

Hey, Scripting Guy! Answer A constant variable is created by using the New-Variable cmdlet, for example:

New-Variable c "c" -Option Constant

   After a variable is created as a constant, it cannot be removed until the console (or ISE) is closed and reopened.

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.