Azure Stack ASDK - RegisterWithAzure.ps1 execution error RRS feed

  • Question

  • Hi,

    I have the following error when I Try to run the PowerShell script. Known bug in the script ? Any idea?

    downloaded from https://github.com/Azure/AzureStack-Tools/blob/master/Registration/RegisterWithAzure.ps1
    executed from the development kit host, as the with azurestack\azurestackadmin account, with elevated privileges )


    VERBOSE: Importing cmdlet 'Set-RoleDefinition'.
    VERBOSE: Importing cmdlet 'Trace-ECEScript'.
    VERBOSE: Importing function 'Test-EceInterface'.
    Import-Module : Cannot overwrite variable ErrorActionPreference because the variable has been
    optimized. Try using the New-Variable or Set-Variable cmdlet (without any aliases), or dot-source
    the command that you are using to set the variable.
    At C:\DATA\AzureStack-Tools-master\AzureStack-Tools-master\Registration\RegisterWithAzure.ps1:93
    + Import-Module C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1  ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : WriteError: (ErrorActionPreference:String) [Import-Module], Session
        + FullyQualifiedErrorId : VariableNotWritableRare,Microsoft.PowerShell.Commands.ImportModuleC

    Wednesday, July 12, 2017 10:43 AM


All replies

  • Hi DanielWe are investigating this issue now and will reply shortly with 'next steps'



    Gary Gallanes

    Thursday, July 13, 2017 4:55 PM
  • Thank you Gary,

    I entered the parameters "manually" with the command prompt.


    After I rexecuted the script with all the parameters, it worked.

    C:\temp\RegisterWithAzure.ps1 -azureSubscriptionId "5e0ae55d-0b7a-47a3-afbc-8b37xxxxxxxx" `
    -azureDirectoryTenantName "contoso.onmicrosoft.com" `
    -azureAccountId servicexxxx@contoso.onmicrosoft.com

    but the error message was not very clear...anyway.

    Thursday, July 13, 2017 9:26 PM
  • Glad to know that you got it working. Thanks sharing your experience.
    Monday, July 24, 2017 10:55 AM