|
| 1 | +TOPIC |
| 2 | + about_version_profiles |
| 3 | + |
| 4 | +SHORT DESCRIPTION |
| 5 | + Version profiles provide a mechanism for managing powershell cmdlets that |
| 6 | + target specific versions of azure services supported in different instances |
| 7 | + of Azure. |
| 8 | + |
| 9 | +LONG DESCRIPTION |
| 10 | + Different concrete instances of Azure (AzureCloud, AzureChinaCloud, |
| 11 | + AzureGermanCloud, AzureUSGovernmentCloud, AzureStack) may have different |
| 12 | + versions of Azure services installed, with different capabilities. Azure |
| 13 | + Version Profiles provide a mechanism for managing these version differences. |
| 14 | + |
| 15 | + Each Azure instance has a discoverable set of supported version profiles. |
| 16 | + |
| 17 | + A user can select a version profile supported by the instances of Azure they |
| 18 | + target, and this version profile corresponds to versions of the Azure |
| 19 | + PowerShell modules. Users can then select these Azure PowerShell module |
| 20 | + versions and be confident that their scripts will work when targeting those |
| 21 | + Azure instances. |
| 22 | + The AzureRM.Bootstrapper module provides cmdlets to discover, acquire, and |
| 23 | + use modules that are appropriate for the azure version profile you are targeting. |
| 24 | + You can also use Tags in the AzureRM modules to discover profile information |
| 25 | + for each module version. |
| 26 | + |
| 27 | + Tags for a Profile use the form VersionProfile:2017-03-09-profile |
| 28 | + The AzureRM bootstrapper module uses the PowerShell Gallery to install and |
| 29 | + load needed modules when you want to target a specific version profile. |
| 30 | + |
| 31 | +EXAMPLES |
| 32 | +Finding appropriate version profiles |
| 33 | + Use the Get-AzureRmProfile cmdlet to discover available profile versions, |
| 34 | + and profile versions supported by an Azure instance. |
| 35 | + |
| 36 | + Get-AzureRmProfile -ListAvailable |
| 37 | + |
| 38 | + lists all available version profiles. |
| 39 | + |
| 40 | + Use-AzureRmProfile -Profile 2017-03-09-profile |
| 41 | + |
| 42 | + Installs and loads cmdlets for one of the listed profiles. |
| 43 | + |
| 44 | +Targeting all Azure Instances |
| 45 | + Get-AzureRmProfile |
| 46 | + |
| 47 | + Lists the profiles that are currently installed on the machine. |
| 48 | + |
| 49 | + Use-AzureRmProfile -Profile 2017-03-09-profile |
| 50 | + |
| 51 | + Installs and loads cmdlets compatible with one of the listed profiles. |
| 52 | + |
| 53 | +Targeting the Latest Stable Features |
| 54 | + Use-AzureRmProfile -Profile Latest |
| 55 | + |
| 56 | + Installs and loads the latest published cmdlets for Azure PowerShell. |
| 57 | + |
| 58 | +Acquiring and Loading All Azure modules using the BootStrapper |
| 59 | + Use-AzureRmProfile -Profile '2017-03-09-profile' -Force |
| 60 | + |
| 61 | + Checks if modules compatible with the '2017-03-09-profile' profile are |
| 62 | + installed in the current scope, downloads and installs the modules if |
| 63 | + necessary, and then loads the modules in the current session. You must |
| 64 | + open a new PowerShell session to target a different version profile. Using |
| 65 | + the 'Force' parameter installs the necessary modules without prompting. |
| 66 | + |
| 67 | +Acquiring and Loading Selected Azure modules using the Bootstrapper |
| 68 | + Use-AzureRmProfile -Profile '2017-03-09-profile' -Module AzureRM.Compute |
| 69 | + |
| 70 | + Checks if an AzureRM.Compute module compatible with the |
| 71 | + '2017-03-09-profile' profile is installed in the current scope, downloads |
| 72 | + and installs the module if necessary, and then loads the module in the |
| 73 | + current session. You must open a new PowerShell session to target a |
| 74 | + different module. |
| 75 | + |
| 76 | +Switching Between Version Profiles |
| 77 | + To switch between version profiles on a machine, in a new PowerShell window, |
| 78 | + execute the following cmdlet: |
| 79 | + |
| 80 | + Use-AzureRmProfile -Profile '2017-03-09-profile' |
| 81 | + |
| 82 | + This loads the modules associated with the '2017-03-09-profile' profile in |
| 83 | + the current session. You must open a new PowerShell session to target a |
| 84 | + different version profile. |
| 85 | + |
| 86 | + |
| 87 | +Updating and Removing Profiles |
| 88 | + To update a profile to the latest versions in that profile and import |
| 89 | + updated modules to the current session, execute the following cmdlet: |
| 90 | + |
| 91 | + Update-AzureRmProfile -Profile 'latest' |
| 92 | + |
| 93 | + This checks if the latest versions of Azure PowerShell modules are |
| 94 | + installed, if not prompts the user if they should be installed and imports |
| 95 | + them into the current session. This should always be executed in a new |
| 96 | + PowerShell session. |
| 97 | + If you would like to update to the latest modules in a Profile and remove |
| 98 | + previously installed versions of the modules, use: |
| 99 | + |
| 100 | + Update-AzureRmProfile -Profile 'latest' -RemovePreviousVersions |
| 101 | + |
| 102 | +Setting and Removing Default Profiles |
| 103 | + To set or update a profile as a default to be used with all Azure PowerShell |
| 104 | + modules, execute the following cmdlet: |
| 105 | + |
| 106 | + Set-AzureRmDefaultProfile -Profile '2017-03-09-profile' |
| 107 | + |
| 108 | + The default profile selection is persisted across shells and sessions. |
| 109 | + After default profile is set using the above cmdlet, the 'Import-Module' |
| 110 | + when used with AzureRm modules will automatically load Azure PowerShell |
| 111 | + modules compatible with the given profile. You may also use API version |
| 112 | + profile cmdlets without the '-profile' parameter. |
| 113 | + |
| 114 | + Import-Module AzureRM.Compute |
| 115 | + Use-AzureRmProfile |
| 116 | + Uninstall-AzureRmProfile |
| 117 | + |
| 118 | + To remove a default profile from all sessions and shells, execute the |
| 119 | + following cmdlet: |
| 120 | + |
| 121 | + Remove-AzureRmDefaultProfile |
| 122 | + |
0 commit comments