5i365 (我心飞扬)当前离线
上尉
TOP
idwma 当前离线
少校
gal|?{$_.Definition -match 'item'}|%{$_.Definition+' -> '+$_.name}复制代码
评分人数
(Get-Alias | Out-String) -replace 'Alias\s+' -split '\r\n' -notmatch '^\s*$'| select -skip 2 | foreach{ $_.Trim() -Replace '(.*) -> (.*)', '$2 -> $1' } | sort | Out-File A.txt复制代码
https://docs.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_split https://docs.microsoft.com/zh-cn/dotnet/api/system.string.split复制代码
cd "$HOME\Desktop" @( "item" "Content" "Process" ) | %{ $a = $_ Get-Alias | ?{ $_.Definition -match $a } | %{ $_.Definition + ' -> ' + $_.name } | Out-File "$a.txt" }复制代码