idwma 当前离线
少校
gal|?{$_.Definition -match 'item'}|%{$_.Definition+' -> '+$_.name}复制代码
评分人数
TOP
(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" ) -join '|' | %{ $a = $_ Get-Alias | ?{ $_.Definition -notmatch $a } | %{ $_.Definition + ' -> ' + $_.name } | Add-Content "abc.txt" }复制代码
@( "item" "Content" "Process" ) -join '|' | %{ $a = $_ Get-Alias |sort{$_.Definition}| ?{ $_.Definition -notmatch $a } | %{ $_.Definition + ' -> ' + $_.name } | Add-Content "abc.txt" }复制代码