안녕하세요.

이번 포스팅은 Azure Stack Powershell 설치에 대한 내용입니다. Azure Stack의 경우 Azure Powershell과 호환되어 동작하기 때문에 Azure Powershll에 대한 설치도 필요합니다.

 

Azure 및 Azure Stak Powershll은 Powershell 5.0 버전이 필요합니다. Powershell에서 $PSVersionTable.PSVersion  명령어를 실행하여 버전을 확인합니다.  

 

Azure 스택에 대한 PowerShell은 PowerShell 갤러리를 통해 설치 됩니다. PSGallery 리포지토리를 등록 하려면 관리자 권한으로 PowerShel을 실행한 후 다음 명령어를 실행합니다.

 

 Set-PSRepository `
-Name "PSGallery" `
-InstallationPolicy Trusted

 

 

기존 버전의 PowerShell 제거

 

Azure Stack Powershell을 설치하기 전에 기존의 모든 Azure PowerShell 모듈을 제거해야 합니다.

 

Get-Module -ListAvailable | where-Object {$_.Name -like “Azure*”} | Uninstall-Module

 

 

인터넷에 연결된 상태에서 Powershell 설치

 

Azure 스택 호환 Azure RM 모듈은 프로필을 통해 설치됩니다. AzureRM 모듈 외에 Azure Stack 관련 PowerShell 모듈을 설치해야 합니다. 다음 명령어를 실행하여 모듈을 설치합니다.

 

# Install the AzureRM.Bootstrapper module. Select Yes when prompted to install NuGet
Install-Module `
  -Name AzureRm.BootStrapper

 

# Install and import the API Version Profile required by Azure Stack into the current PowerShell session.
Use-AzureRmProfile `
  -Profile 2017-03-09-profile -Force

 

Install-Module `
  -Name AzureStack `
  -RequiredVersion 1.2.11

 

정상적으로 설치되어 있는지 확인하려면 다음 명령어를 통해 확인할 수 있습니다.

Get-Module `
  -ListAvailable | where-Object {$_.Name -like "*Azure*"}

 

 

인터넷에 연결되지 않은 상태에서 Powershell 설치

 

만일, Azure Stack Powershell을 설치해야 할 머신이 인터넷에 연결되어 있지 않은 경우 인터넷 연결되어 있는 컴퓨터에 PowerShell 모듈을 다운로드한 후 설치해야 할 머신에 해당 모듈을 전송한 후 설치를 진행해야 합니다.

 

먼저, 인터넷에 연결된 컴퓨터에서 다음 명령어를 실행하여 AzureRM 및 AzureStack Powershell 설치를 위한 패키지를 다운로드 받습니다.

$Path = "C:\temp\AzureStack\" //다운로드 경로//

 

Save-Package `
  -ProviderName NuGet `
  -Source https://www.powershellgallery.com/api/v2 `
  -Name AzureRM `
  -Path $Path `
  -Force `
  -RequiredVersion 1.2.11

 

Save-Package `
  -ProviderName NuGet `
  -Source https://www.powershellgallery.com/api/v2 `
  -Name AzureStack `
  -Path $Path `
  -Force `
  -RequiredVersion 1.2.11

 

패키지 다운로드가 완료되면 해당 패키지를 USB 등으로 복사한 후 Azure Stack 개발 키트로 복사하고 다음 명령어를 실행하여 AzureRM 및 AzureStack 모듈을 설치합니다.

  -Repository $RepoName
$RepoName = "AzureStackNuGetSource"

 

Register-PSRepository `
  -Name $RepoName `
  -SourceLocation $SourceLocation `
  -InstallationPolicy Trusted

 

Install-Module AzureRM `
  -Repository $RepoName

 

Install-Module AzureStack `
  -Repository $RepoName 

 

 

이상으로 Azure Stack PowerShell 설치에 대한 포스팅을 마칩니다.

감사합니다.

 

 

 

 

 

 

 

 

 

 

 

이 포스팅은 다음 페이지의 글을 참고하여 작성하였습니다.

https://docs.microsoft.com/ko-kr/azure/azure-stack/azure-stack-powershell-install

 

 

 

 

 

 

+ Recent posts