「Azure サブスクリプションを使用した Azure Stack の登録」の記載内容がちょっと古くて慌てた件(ドキュメントは英語版を見ましょう~)
と、
PowerShellの実行ポリシーを変えたつもりがちゃんと変わってなくて焦った件。
まずは、PowerShellの実行ポリシーを変えたつもりがちゃんと変わってなくて焦った件。
Azure を使用した Azure Stack の登録の項番6で

PowerShellの実行ポリシーを変えます。
が、エラーです。

いろいろ調べたところ、スコープがあるそうです。>知らんかった(^^;
良記事があったので、引用させてもらいます。
PowerShell の Set-ExecutionPolicy 設定時のスコープ対処
この記事にある通り、「変更しようとしたスコープよりも低いスコープで制限されている」に該当していました。
確かに、スコープで実行ポリシーが違います。

LocalMachineスコープは変わっているけど、ProcessスコープはRemoteSignedのまま、これがエラーの原因。
なので、Processスコープを対象に実行ポリシーを追加で変更します。

PowerShellモジュールのインポートにようやく成功。

「Azure サブスクリプションを使用した Azure Stack の登録」の記載内容がちょっと古くて慌てた件(ドキュメントは英語版を見ましょう~)
Azure を使用した Azure Stack の登録の項番7でAdd-AzsRegistrationを実行するとエラーです。。。

英語版のRegister Azure Stack with your Azure Subscriptionと見比べていると、コマンドレットが違っていることに気づく。。。
Add-AzsRegistrationはなくなって、Set-AzsRegistrationを代わりに使うようです。
※Import-Module .\RegisterWithAzure.psm1 で -Verboseオプション使うと「どういうコマンドレットが使えるか表示できる」のでおススメです。
ということで、登録完了できました。

と、
PowerShellの実行ポリシーを変えたつもりがちゃんと変わってなくて焦った件。
まずは、PowerShellの実行ポリシーを変えたつもりがちゃんと変わってなくて焦った件。
Azure を使用した Azure Stack の登録の項番6で
Import-Module .\RegisterWithAzure.psm1を実行できないので、

PowerShellの実行ポリシーを変えます。
が、エラーです。

いろいろ調べたところ、スコープがあるそうです。>知らんかった(^^;
良記事があったので、引用させてもらいます。
PowerShell の Set-ExecutionPolicy 設定時のスコープ対処
この記事にある通り、「変更しようとしたスコープよりも低いスコープで制限されている」に該当していました。
確かに、スコープで実行ポリシーが違います。

LocalMachineスコープは変わっているけど、ProcessスコープはRemoteSignedのまま、これがエラーの原因。
なので、Processスコープを対象に実行ポリシーを追加で変更します。

PowerShellモジュールのインポートにようやく成功。

「Azure サブスクリプションを使用した Azure Stack の登録」の記載内容がちょっと古くて慌てた件(ドキュメントは英語版を見ましょう~)
Azure を使用した Azure Stack の登録の項番7でAdd-AzsRegistrationを実行するとエラーです。。。

英語版のRegister Azure Stack with your Azure Subscriptionと見比べていると、コマンドレットが違っていることに気づく。。。
Add-AzsRegistrationはなくなって、Set-AzsRegistrationを代わりに使うようです。
※Import-Module .\RegisterWithAzure.psm1 で -Verboseオプション使うと「どういうコマンドレットが使えるか表示できる」のでおススメです。
ということで、登録完了できました。

0 件のコメント:
コメントを投稿