כיצד להתקין Microsoft Azure PowerShell module באמצעות פקודת PowerShell

שלום, בעבר פרסמתי מדריך אודות התקנה של Azure PowerShell.
באותו מדריך הוסבר כיצד להתקין Microsoft Azure PowerShell באמצעות Microsoft Web Platform Installer.
לפני מס' ימים בעודי מנסה לבצע עדכון לגרסת ה-Azure PowerShell module באמצעות פקודת PowerShell נוכחתי להבין שהעובדה שההתקנה של Microsoft Azure PowerShell module בוצעה באמצעות Microsoft Web Platform Installer לא מאפשרת לי לבצע עדכון/שדרוג ל-module באמצעות פקודה.
זו השגיאה שקיבלתי:


PS C:\WINDOWS\system32> Update-Module -Name Azure
Update-Module : Module 'Azure' was not installed by using Install-Module, so it cannot be updated.
At line:1 char:1
+ Update-Module -Name Azure
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Azure:String) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : ModuleNotInstalledUsingInstallModuleCmdlet,Update-Module

ולכן, החלטתי שיהיה נכון שאציג בפניכם גם את האפשרות להתקין Microsoft Azure PowerShell module  באמצעות פקודת PowerShell.

הכל בתוך הפוסט, כנסו!

  1. גשו לתפריט "התחל" והריצו את חלון ה-PowerShell כ-Administrator
  2. רשמו את הפקודה Install-Module Azure -AllowClobber ולחצו Enter.
    הסוויץ –AllowClobber נועד לאפשר דריסה של Azure PoweShell modules קיימים במידה ומותקנים ולהימנע מקבלת הודעות כמו זו למשל:

PackageManagement\Install-Package : A command with name 'Get-AzureStorageContainerAcl' is already available on this system. This module 'Azure' may override the existing
commands. If you still want to install this module 'Azure', use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

3.   יתכן ותקבלו את האזהרה הבאה:

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you
sure you want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N")
:

כתבו Y ולחצו על Enter.

4.   תהליך ההתקנה יחל ויערך כמס' דקות בודדות

5.  בסיום תועברו לשורת פקודה חדשה וזה אומר שתהליך ההתקנה יסתיים.

6.   באמצעות הפקודה הבאה  Get-Module -ListAvailable *Azure*   תוכלו לקבל את רשימות ה-Azure modules שמותקנים לכם על המחשב והגרסא שלהם .

הוספת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *

sixteen − six =

הרשמו לרשימת התפוצה!