powershell实战指南第四章动手实验

实验环境:windows10 运行powershell ISE x86

1、显示正在运行的进程
Get-Process
**powershell实战指南第四章动手实验
**

2、显示最新的20个应用程序日志
Get-eventlog –LogName “application” -Netest 20
powershell实战指南第四章动手实验

3、显示所有类型为“Cmdlet”的命令
Get-Command -CommandType “Cmdlet”
powershell实战指南第四章动手实验

4、显示所有的别名
Get-alias
powershell实战指南第四章动手实验

5、创建一个新的别名,在运行他
New-Alias -Name “np” notepad //为记事本创建了新别名
Np //输入np后 打开记事本
powershell实战指南第四章动手实验

6、查看所有M开头的服务名称
Get-service -DisplayName “M*” display显示
powershell实战指南第四章动手实验

7、显示防火墙规则
Get-netfirewallrule
powershell实战指南第四章动手实验

8、显示防火墙入站规则
Get-netfirewallrule -direction inbound