Skip to content

Commit 71c4aea

Browse files
committed
doc: update docs/powershell.md #845
1 parent 3662bb7 commit 71c4aea

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

docs/powershell.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PowerShell 备忘清单
77
---
88

99
### 辅助命令
10+
<!--rehype:wrap-class=row-span-2-->
1011

1112
**_PowerShell 的命令遵循动词-名词格式_** 一些常见的动词:
1213

@@ -57,6 +58,7 @@ Get-Process | Get-Member
5758
```
5859

5960
### 对象操作
61+
<!--rehype:wrap-class=col-span-2-->
6062

6163
**Select-Object:** 选择对象的特定属性或自定义其显示
6264

@@ -103,6 +105,7 @@ Get-Process | Format-List -Property Name, CPU # fl alias
103105
```
104106

105107
### 文件系统
108+
<!--rehype:wrap-class=col-span-2-->
106109

107110
```PowerShell
108111
New-Item -path file.txt -type 'file' -value 'contents'
@@ -143,14 +146,26 @@ Get-CimInstance -ClassName Win32_VideoController
143146

144147
### 命名空间 & 类
145148

149+
列出所有类名
150+
146151
```PowerShell
147-
# 列出所有类名
148152
Get-CimClass | Select-Object -ExpandProperty CimClassName
149-
# 探索 root\cimv2 命名空间中的各种 WMI 类
153+
```
154+
<!--rehype:className=wrap-text-->
155+
156+
探索 root\cimv2 命名空间中的各种 WMI 类
157+
158+
```PowerShell
150159
Get-CimClass -Namespace root\cimv2
151-
# 探索 root\cimv2 命名空间下的子 WMI 命名空间
160+
```
161+
<!--rehype:className=wrap-text-->
162+
163+
探索 root\cimv2 命名空间下的子 WMI 命名空间
164+
165+
```PowerShell
152166
Get-CimInstance -Namespace root -ClassName __NAMESPACE
153167
```
168+
<!--rehype:className=wrap-text-->
154169

155170
### 网络管理
156171

@@ -169,7 +184,6 @@ Get-NetRoute
169184
170185
# 测试远程主机上的端口是否开放
171186
Test-NetConnection google.com -Port 80
172-
173187
```
174188

175189
### 用户和组管理
@@ -193,13 +207,18 @@ Add-LocalGroupMember -Group Administrators -Member UserToAdd
193207

194208
### 安全性和权限
195209

210+
获取文件/目录的访问控制列表
211+
196212
```PowerShell
197-
# 获取文件/目录的访问控制列表
198213
Get-Acl C:\Path\To\File.txt
214+
```
215+
216+
设置文件/目录的访问控制列表
199217

200-
# 设置文件/目录的访问控制列表
218+
```PowerShell
201219
Set-Acl -Path C:\Path\To\File.txt -AclObject $aclObject
202220
```
221+
<!--rehype:className=wrap-text-->
203222

204223
### 注册表管理
205224

0 commit comments

Comments
 (0)