powershell - Remove all variables

后端 未结 8 784
礼貌的吻别
礼貌的吻别 2020-12-31 05:05

I want to remove all user-created variables at the start of a script.

Currently I am doing Remove-Variable -Name * but it tries to dele

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 05:43

    You can't. You'll have to keep track of the available variables before the script started and remove any variables added after the script executed.

提交回复
热议问题