PowerShell
玩一下
四月笈
纵有疾风起. The cross-set of interest and living will not fail to be pursued.
展开
-
About_对象的功能
Learning about methodsTo find definitions of the methods of an object, go to help topic for theobject type and look for its methods page. For example, the following pagedescribes the methods of process objects System.Diagnostics.Process.To determine原创 2021-11-02 11:29:39 · 65 阅读 · 0 评论 -
PowerShell 常用路径
#Powershell的安装路径,该路径下是powershell的配置文件$pshome#模块的注册路径$PSModulePath原创 2021-10-30 10:19:42 · 1369 阅读 · 0 评论 -
powershell 常用命令
Wait-process名称 Wait-Process摘要 Waits for the processes to be stopped before accepting more input.2. gm名称 Get-Member摘要 Gets the properties and methods of objects.原创 2021-10-27 22:30:49 · 220 阅读 · 0 评论 -
powershell零散知识点
CliXML包含了比CSV更多的信息。 CliXML是powershell独有的,但是能解析XML文件的都能解析CliXML。 默认情况下,Windows PowerShell 不会从当前位置加载命令。原因:待续 调用在本文件夹下的命令,命令前加 .\ 调用其他文件夹下的命令。命令中若包含空格,则需要用引号包裹,记得还要加上调用符 & Cmdlet以某种方式修改系统,并且内部有一个定义了的影响级别,不可更改。 工作原理: 待续...原创 2021-10-24 23:14:13 · 584 阅读 · 0 评论 -
powershell的变量与数据
通过重定向创建脚本如果想要执行的脚本不是很长,我们甚至可以直接在控制台中要执行的语句重定向给一个脚本文件。这样有个缺点,就是您的代码必须放在闭合的引号中。这样的书写方式一旦在脚本内部也有引号时,是一件很痛苦的事。甚至您还可能希望在脚本中换行。下面的Here-strings例子不错,也就是将脚本文件通过@' '@闭合起来。PS E:> @'>> Get-Date>> $Env:CommonProgramFiles>> #Script End>原创 2021-10-24 22:56:39 · 695 阅读 · 0 评论 -
对参数集的理解
就拿 get-evenlog 做示例:PS [LAPTOP-N7AS0BS5] >help Get-EventLog名称 Get-EventLog摘要 Gets the events in an event log, or a list of the event logs, on the local computer or remote compu ters.语法 Get-EventLog [-LogName] <System.String&原创 2021-10-23 11:10:55 · 303 阅读 · 0 评论 -
verb 积累
标准:Get:读取、打开slect:选取where:选择待续原创 2021-10-21 22:40:21 · 57 阅读 · 0 评论 -
三大基柱(常用)
Get-Verb. 运行此命令时,将返回大多数命令遵循的谓词的列表。 此外,响应还会说明这些谓词执行哪些操作。 由于大多数命令都遵循这种命名方式,因此,它设置了命令的预期操作,这样有助于你选择适当的命令,也可帮助你在创建命令时为其命名。 Get-Command. 此命令会检索计算机上安装的所有命令的列表。 Get-Member. 它在基于对象的输出上运行,并且能够发现可用于命令的对象、属性和方法。 Get-Help. 以命令名称为参数调用此命令,将显示一个帮助页面,其中说明了命令的各个部分。谓词原创 2021-10-21 19:28:39 · 132 阅读 · 0 评论 -
以管理员身份提升Windows PowerShell的权限
$ start-process PowerShell -verb runas可以拿来删除一些需要权限才能删除的文件。原创 2021-10-21 16:17:50 · 1039 阅读 · 0 评论