使用powershell的remove


使用Remove-Module -Name Functions2 只是移除當前會話的模塊

並且Import-Module -Name Functions2Remove-Module -Name Functions2是相對應的,只有先import才能remove,不然會提示找不到模塊

使用get-module -ListAvailable是得到當前PC上所有的模塊

使用get-module是得到當前會話下的模塊

 

創建一個測試模塊很簡單

官方的例子:

Writing portable modules

如果你只是想快速的創建一個測試模塊,那就在C:\Users\names\Documents\WindowsPowerShell\Modules下創建一個空文件夾,在文件夾中創建一個后綴為.psm1的文檔


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM