microsoft / OpenHack-FHIR

This repository hosts the guidance and assets for delivering an OpenHack focusing on FHIR and Microsoft's API for FHIR.
Creative Commons Attribution 4.0 International
87 stars 41 forks source link

Procedure to Bootstap Mac Powershell #24

Open jakiefermsft opened 3 years ago

jakiefermsft commented 3 years ago

A few of us on mac got stuck with the very first powershell step and getting the correct modules installed. The following process was used by a few of us and seemed to work pretty well.

Bootstrap Mac Powershell

This should get you "clean", then:

You should then be able to login, set you subscription then set your azuread to point at the new tenant.

When you go to run the first ps1 file you need to add the -adminPassword as explained in the docs because you are on mac.

yradsmikham commented 3 years ago

Hi, thanks for posting this. I'm also on MacOS, and am trying to follow these steps, but am struggling a bit.

I installed Powershell 7.0.3.

🍺  powershell was successfully installed!
 ~  pwsh
PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

Then, I attempt to uninstall the modules you listed:

PS /Users/yvonneradsmikham> Uninstall-Module Az
Uninstall-Package: /usr/local/microsoft/powershell/7/Modules/PowerShellGet/PSModule.psm1:12731
 Line |
12731 |  …        $null = PackageManagement\Uninstall-Package @PSBoundParameters
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | No match was found for the specified search criteria and module names 'Az'.

PS /Users/yvonneradsmikham> Uninstall-Module Azure
Uninstall-Package: /usr/local/microsoft/powershell/7/Modules/PowerShellGet/PSModule.psm1:12731
 Line |
12731 |  …        $null = PackageManagement\Uninstall-Package @PSBoundParameters
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | No match was found for the specified search criteria and module names 'Azure'.

PS /Users/yvonneradsmikham> Uninstall-Module AzureRM
Uninstall-Package: /usr/local/microsoft/powershell/7/Modules/PowerShellGet/PSModule.psm1:12731
 Line |
12731 |  …        $null = PackageManagement\Uninstall-Package @PSBoundParameters
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | No match was found for the specified search criteria and module names 'AzureRM'.

PS /Users/yvonneradsmikham> Uninstall-Module AzureAD
Uninstall-Package: /usr/local/microsoft/powershell/7/Modules/PowerShellGet/PSModule.psm1:12731
 Line |
12731 |  …        $null = PackageManagement\Uninstall-Package @PSBoundParameters
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | No match was found for the specified search criteria and module names 'AzureAD'.

Then, attempt to unregister the Posh Test Gallery (which doesn't appear to exist):

PS /Users/yvonneradsmikham> Unregister-PSRepository -Name 'Posh Test Gallery'
Unregister-PackageSource: /usr/local/microsoft/powershell/7/Modules/PowerShellGet/PSModule.psm1:12884
 Line |
12884 |  …     $null = PackageManagement\Unregister-PackageSource @PSBoundParame …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Unable to find repository 'Posh Test Gallery'. Use Get-PSRepository to see all available repositories.

Restarting powershell...

PS /Users/yvonneradsmikham> exit
 ~  pwsh
PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

And attempt to install the modules:

PS /Users/yvonneradsmikham> Install-Module Az
Install-Package: /usr/local/microsoft/powershell/7/Modules/PowerShellGet/PSModule.psm1:9709
Line |
9709 |  … talledPackages = PackageManagement\Install-Package @PSBoundParameters
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | No match was found for the specified search criteria and module name 'Az'. Try Get-PSRepository to see all
     | available registered module repositories.

Am I doing something wrong?