![Powershell Core 6.2 Cookbook](https://wfqqreader-1252317822.image.myqcloud.com/cover/704/36698704/b_36698704.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
Please perform the following steps:
- Open PowerShell Core.
- Type Get-Command. Notice that all available cmdlets on the system will be displayed. Depending on the modules installed on your system, this will be a lot.
- Type Get-Command New-Item -Syntax. Notice that, this time, it's not the cmdlet that's returned, but the syntax that's displayed:
![](https://epubservercos.yuewen.com/57DF63/19470379901495806/epubprivate/OEBPS/Images/97e0cba1-91b6-42d6-8532-66fd7d3952fb.png?sign=1739235622-nuvdFRTBv5AcXJCPDiiDqOH5Rb7Ymnxn-0-5ad287df2e74133343481933f187efcc)
- Type Get-Command -Verb Get -Module Microsoft.PowerShell.Utility. Notice here that all read-only cmdlets of a specific module are returned, thereby greatly narrowing down the results:
![](https://epubservercos.yuewen.com/57DF63/19470379901495806/epubprivate/OEBPS/Images/de27ec6d-10c6-4d5d-a70d-3d702435966b.png?sign=1739235622-SleIbCpTNogKWynPiaB6U3dA0ji48TMa-0-2cf32bd5fbff095041d424628069897a)
- Type Get-Command -CommandType Application. This time, all external applications (in other words, binaries) are returned. Try to favor native PowerShell cmdlets over external applications where possible:
![](https://epubservercos.yuewen.com/57DF63/19470379901495806/epubprivate/OEBPS/Images/d2d69aaf-c186-4dad-8c39-dc71a79e2a8a.png?sign=1739235622-HYdJK7jJOyiAawwGuHCeq4nQwMOyT8La-0-468144e5745ffa5b9b9db797c75e6438)
- Type Get-Command -ParameterName ComputerName,CimSession,PSSession. This is one of my favorites; with this parameter, only cmdlets that have certain parameters are returned. In this instance, all remote-capable cmdlets will be returned. This parameter, however, only searches through all cmdlets available in the current session:
![](https://epubservercos.yuewen.com/57DF63/19470379901495806/epubprivate/OEBPS/Images/1e06f81a-2d6f-4f65-996a-408a2314c05b.png?sign=1739235622-UZYyqTCDVK7LjLDhMb3IY5EoWyKWICv6-0-49567f0c16a7bc57867ec8633c4226af)
- Type Get-Command *Process,*Item. Notice that, this time, a wildcard search is performed on all cmdlets that exist on the system.
- Type New-Alias -Name Start-Process -Value hostname and then type Get-Command Start-Process. Only the alias will be returned now, effectively hiding the cmdlet, Start-Process.
- Type Get-Command Start-Process -All. This time, the alias as well as the original cmdlet are returned.