PowerShell Core 6.2 发布,侧重于性能改进
百度智能云 云生態(tài)狂歡季 熱門云產(chǎn)品1折起>>>??
PowerShell Core 6.2 GA 已發(fā)布,PowerShell Core 是 PowerShell 的開源版本,適用于 Linux,macOS 和 Windows。
有關(guān)?PowerShell Core 6.2 的安裝信息,請查看安裝文檔。
另外,PowerShell Core 與 Windows PowerShell 可同時運行,兩者能夠彼此獨立使用。這就意味著我們可以繼續(xù)將 Windows PowerShell 用于現(xiàn)有腳本,同時使用 PowerShell Core 實現(xiàn)新的自動化或探索其新功能。
更新內(nèi)容
自 6.1.0 發(fā)布(2018 年 9 月)以來,開發(fā)團隊已經(jīng)對 6.2 版本進行了 560 次更改,具體的變更詳情請點此查看。PowerShell Core 6.2 版本主要側(cè)重于性能改進、錯誤修復(fù)以及可提升效率的較小 命令行(cmdlet)/語言增強功能。
實驗性功能
未找到命令時的建議
Enable-ExperimentalFeature -Name PSCommandNotFoundSuggestion當用戶輸入命令行時,如果出現(xiàn)拼寫錯誤的情況,此功能將使用模糊匹配來查找使用者可能打算輸入的命令,并提供建議。
PS> Get-Commnd Get-Commnd : The term 'Get-Commnd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Get-Commnd + ~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-Commnd:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundExceptionSuggestion [4,General]: The most similar commands are: Get-Command, Get-Content, Get-Job, Get-Module, Get-Event, Get-Host, Get-Member, Get-Item, Set-Co上面的這個例子中,使用者拼寫錯了Get-Command并且模糊地匹配了很多最可能、以及最不可能的建議。
隱式遠程批處理
Enable-ExperimentalFeature -Name PSImplicitRemotingBatching在管道中使用隱式遠程處理時,PowerShell 會獨立處理管道中的每個命令。這導(dǎo)致在
管道的執(zhí)行過程中反復(fù)地在客戶端和目標系統(tǒng)之間對對象進行序列化和反序列化。
若應(yīng)用此特性,PowerShell 會分析管道并確定命令是否可以安全運行,或者命令是否存在于目標系統(tǒng)上,并且能夠遠程執(zhí)行整個管道,最后只將結(jié)果序列化和反序列化回客戶端。
詳情請查看發(fā)布公告。
總結(jié)
以上是生活随笔為你收集整理的PowerShell Core 6.2 发布,侧重于性能改进的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP 安全问题入门:10 个常见安全问
- 下一篇: 五分钟创建一个自己的NPM包