為 windows 伺服器安裝 PowerShell 管理庫

來源:互聯網
上載者:User

最近在摸索一種命令方式備份Hyper-V裡的虛擬機器,因為平時備份都是手動關閉VM,然後Export,這樣浪費很多的時間,於是折騰了下,想用命令實現自動化完成VM的備份。

查閱了下資料,看到了一個開源的軟體能夠用此Powershell Management Library裡的命令完成大部分的虛擬機器管理操作,在這裡分享此網站:

http://pshyperv.codeplex.com/

但是在Import 此Module時出現如下錯誤:

Import-Module : There were errors in loading the format data file:

Microsoft.PowerShell, , C:\Program Files\modules\Hyperv\hyperv.

Format.ps1xml : File skipped because of the following validation

exception: File C:\Program Files\modules\Hyperv\hyperv.Format.

ps1xml cannot be loaded. The file C:\Program Files\modules\Hyperv

\hyperv.Format.ps1xml is not digitally signed. The script will not

execute on the system. Please see "get-help about_signing"

for more details...

At line:1 char:14

+ Import-Module <<<< 'C:\Program Files\modules\Hyperv'

+ CategoryInfo : InvalidOperation: (:) [Import-Module],

RuntimeException + FullyQualifiedErrorId : FormatXmlUpate

Exception,Microsoft.PowerShell.Commands.ImportModule

Command

這是powershell的預設安全設定禁用了執行指令碼,要啟用這個功能需要擁有管理員的許可權。,所以用如下命令更改為不受限:

set-ExecutionPolicy Unrestricted

然後Imort-Module "HyperV庫路徑",然後輸入如下命令:

Get-Command -Module HyperV,在PowerShell 命令列下會出現此命令的協助指令

更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/OS/server/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.