Azure Stack Hub 1910以降で特権エンドポイントへの接続に失敗する

Azure Stack Hub 1910にバージョンアップ後、手元の環境では特権エンドポイントへの接続に失敗していましたので、その回避策の記録です。

発生したエラーは下記

using password from E:\azurestack\ERCSWorks\password.txt .
警告: The names of some imported commands from the module 'ECEClient' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
New-PSSession : Running startup script threw an error: Cannot find the Windows PowerShell data file 'Microsoft.AzureStack.DNS.psd1' in directory 'C:\Program Files\WindowsPowerShell\Modules\Microsoft.AzureStack.DNS\ja-JP\', or in any parent culture directories..
発生場所 E:\azurestack\ERCSWorks\ConnectERCS.ps1:24 文字:12
+ $session = New-PSSession -ComputerName $ErcsVmIP -ConfigurationName P ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], RemoteException
    + FullyQualifiedErrorId : PSSessionOpenFailed
 

Enter-PSSession : パラメーター 'Session の引数を確認できません。引数が null または空です。null または空でない引数を指定して、コマンドを再度実行してください。
発生場所 E:\azurestack\ERCSWorks\ConnectERCS.ps1:30 文字:17
+ Enter-PSsession $session
+                 ~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Enter-PSSession]、ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.EnterPSSessionCommand

私は、ラッパーのPowerShellを自分で書いてそれを使用して接続していますので少し通常とエラーメッセージの表記が異なりますが、肝の部分は下記部分です。

New-PSSession : Running startup script threw an error: Cannot find the Windows PowerShell data file 'Microsoft.AzureStack.DNS.psd1' in directory 'C:\Program Files\WindowsPowerShell\Modules\Microsoft.AzureStack.DNS\ja-JP\', or in any parent culture directories..

ja-JPを探しにいってます。どうやら日本語環境であることを認識してしまったがゆえのエラーに見えます。というわけで、接続の際にen-USを使うように明示することで回避できました。

$session = New-PSSession -ComputerName $ErcsVmIP -ConfigurationName PrivilegedEndpoint -Credential $credential -SessionOption (New-PSSessionOption -UICulture en-US)

以上、参考になる部分あれば嬉しいです。

コメントを残す