如何清除powershell中的变量内容 [英] How to clear variable content in powershell

查看:83
本文介绍了如何清除powershell中的变量内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我昨天刚开始学习 powershell.非常新进入powershell.我为测试目的创建了很多变量.以下是我关于变量的问题

I just started yesterday learning about powershell. Very new into powershell. I have created quite a few variables for testing purposes. Below is my questions on variables

  1. 如何列出我之前创建的所有变量?
  2. 然后如何清除变量的所有内容?
  3. 如何移除/删除变量?

推荐答案

  1. 如何列出之前创建的所有变量?

  1. How can I list back all the variables that I have created before?

  • 这将获取所有变量,而不仅仅是您创建的变量,您需要过滤到您关心的变量:Get-Variable -name

然后我如何清除变量的所有内容?

How do I then clear all the contents of the variables?

  • Clear-Variable -name
  • Remove-Variable -name

这篇关于如何清除powershell中的变量内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆