PowerShell Core 6.2 发布,侧重于性能改进
百度智能云 云生態(tài)狂歡季 熱門(mén)云產(chǎn)品1折起>>>??
PowerShell Core 6.2 GA 已發(fā)布,PowerShell Core 是 PowerShell 的開(kāi)源版本,適用于 Linux,macOS 和 Windows。
有關(guān)?PowerShell Core 6.2 的安裝信息,請(qǐng)查看安裝文檔。
另外,PowerShell Core 與 Windows PowerShell 可同時(shí)運(yùn)行,兩者能夠彼此獨(dú)立使用。這就意味著我們可以繼續(xù)將 Windows PowerShell 用于現(xiàn)有腳本,同時(shí)使用 PowerShell Core 實(shí)現(xiàn)新的自動(dòng)化或探索其新功能。
更新內(nèi)容
自 6.1.0 發(fā)布(2018 年 9 月)以來(lái),開(kāi)發(fā)團(tuán)隊(duì)已經(jīng)對(duì) 6.2 版本進(jìn)行了 560 次更改,具體的變更詳情請(qǐng)點(diǎn)此查看。PowerShell Core 6.2 版本主要側(cè)重于性能改進(jìn)、錯(cuò)誤修復(fù)以及可提升效率的較小 命令行(cmdlet)/語(yǔ)言增強(qiáng)功能。
實(shí)驗(yàn)性功能
未找到命令時(shí)的建議
Enable-ExperimentalFeature -Name PSCommandNotFoundSuggestion當(dāng)用戶(hù)輸入命令行時(shí),如果出現(xiàn)拼寫(xiě)錯(cuò)誤的情況,此功能將使用模糊匹配來(lái)查找使用者可能打算輸入的命令,并提供建議。
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上面的這個(gè)例子中,使用者拼寫(xiě)錯(cuò)了Get-Command并且模糊地匹配了很多最可能、以及最不可能的建議。
隱式遠(yuǎn)程批處理
Enable-ExperimentalFeature -Name PSImplicitRemotingBatching在管道中使用隱式遠(yuǎn)程處理時(shí),PowerShell 會(huì)獨(dú)立處理管道中的每個(gè)命令。這導(dǎo)致在
管道的執(zhí)行過(guò)程中反復(fù)地在客戶(hù)端和目標(biāo)系統(tǒng)之間對(duì)對(duì)象進(jìn)行序列化和反序列化。
若應(yīng)用此特性,PowerShell 會(huì)分析管道并確定命令是否可以安全運(yùn)行,或者命令是否存在于目標(biāo)系統(tǒng)上,并且能夠遠(yuǎn)程執(zhí)行整個(gè)管道,最后只將結(jié)果序列化和反序列化回客戶(hù)端。
詳情請(qǐng)查看發(fā)布公告。
總結(jié)
以上是生活随笔為你收集整理的PowerShell Core 6.2 发布,侧重于性能改进的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: PHP 安全问题入门:10 个常见安全问
- 下一篇: 五分钟创建一个自己的NPM包