Sync reference docs upstream from the docs repo (#123)

Co-authored-by: Mike F. Robbins <mikefrobbins@users.noreply.github.com>
Co-authored-by: NoriZC <110961157+NoriZC@users.noreply.github.com>
This commit is contained in:
Mike F. Robbins 2023-11-19 23:38:12 -06:00 коммит произвёл GitHub
Родитель 617ff6efe7
Коммит ab0ed227e0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 877 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,42 @@
---
Module Name: Az.Tools.Migration
Module Guid: cb471070-37cc-4484-9665-adf1502b4e3a
Help Version: 1.0.0.0
Locale: en-US
---
# Az.Tools.Migration Module
## Description
Commands to help migrate from **AzureRM** to **Az** PowerShell modules.
## Az.Tools.Migration Cmdlets
### [Disable-AzUpgradeDataCollection](Disable-AzUpgradeDataCollection.md)
Disables the setting that allows **Az.Tools.Migration** to send usage metrics to Microsoft.
### [Enable-AzUpgradeDataCollection](Enable-AzUpgradeDataCollection.md)
Enables the setting that allows **Az.Tools.Migration** to send usage metrics to Microsoft.
### [Find-AzUpgradeCommandReference](Find-AzUpgradeCommandReference.md)
Searches for **AzureRM** PowerShell command references in the specified file or folder.
### [Get-AzUpgradeAliasSpec](Get-AzUpgradeAliasSpec.md)
Returns a dictionary containing cmdlet alias mappings for the specified **Az** module version.
### [Get-AzUpgradeCmdletSpec](Get-AzUpgradeCmdletSpec.md)
Returns a dictionary containing cmdlet specification objects for the specified module.
### [Invoke-AzUpgradeModulePlan](Invoke-AzUpgradeModulePlan.md)
Invokes the specified module upgrade plan.
### [New-AzUpgradeModulePlan](New-AzUpgradeModulePlan.md)
Generates a new upgrade plan for migrating to the **Az** PowerShell module.

Просмотреть файл

@ -0,0 +1,50 @@
---
external help file: Az.Tools.Migration-help.xml
Module Name: az.tools.migration
online version:
schema: 2.0.0
---
# Disable-AzUpgradeDataCollection
## SYNOPSIS
Disables the setting that allows **Az.Tools.Migration** to send usage metrics to Microsoft.
## SYNTAX
```
Disable-AzUpgradeDataCollection [<CommonParameters>]
```
## DESCRIPTION
Disables the setting that allows **Az.Tools.Migration** to send usage metrics to Microsoft. Usage
metrics are opted-in by default. To disable usage metrics, run this cmdlet. This setting is scoped
to the user profile and persists between PowerShell sessions.
## EXAMPLES
### EXAMPLE 1
Disables the metrics collection for Az.Tools.Migration.
```powershell
Disable-AzUpgradeDataCollection
```
## PARAMETERS
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

Просмотреть файл

@ -0,0 +1,51 @@
---
external help file: Az.Tools.Migration-help.xml
Module Name: az.tools.migration
online version:
schema: 2.0.0
---
# Enable-AzUpgradeDataCollection
## SYNOPSIS
Enables the setting that allows** Az.Tools.Migration** to send usage metrics to Microsoft.
## SYNTAX
```
Enable-AzUpgradeDataCollection [<CommonParameters>]
```
## DESCRIPTION
Enables the setting that allows **Az.Tools.Migration** to send usage metrics to Microsoft. Usage
metrics are opted-in by default. To disable usage metrics, run the
`Disabled-AzUpgradeDataCollection` cmdlet. This setting is scoped to the user profile and persists
between PowerShell sessions.
## EXAMPLES
### EXAMPLE 1
Enables the metrics collection for **Az.Tools.Migration**.
```powershell
Enable-AzUpgradeDataCollection
```
## PARAMETERS
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

Просмотреть файл

@ -0,0 +1,161 @@
---
external help file: Az.Tools.Migration-help.xml
Module Name: az.tools.migration
online version:
schema: 2.0.0
---
# Find-AzUpgradeCommandReference
## SYNOPSIS
Searches for **AzureRM** PowerShell command references in the specified file or folder.
## SYNTAX
### ByFileAndModuleSpec
```
Find-AzUpgradeCommandReference -FilePath <String>
-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>
[<CommonParameters>]
```
### ByFileAndModuleVersion
```
Find-AzUpgradeCommandReference -FilePath <String> -AzureRmVersion <String> [<CommonParameters>]
```
### ByDirectoryAndModuleSpec
```
Find-AzUpgradeCommandReference -DirectoryPath <String>
-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>
[<CommonParameters>]
```
### ByDirectoryAndModuleVersion
```
Find-AzUpgradeCommandReference -DirectoryPath <String> -AzureRmVersion <String> [<CommonParameters>]
```
## DESCRIPTION
Searches for **AzureRM** PowerShell command references in the specified file or folder. When
reviewing the specified file or folder, all of the cmdlets used in the files will be analyzed and
compared against known **AzureRM** PowerShell commands. If commands match a known **AzureRM**
cmdlet, then output will be returned that shows the position/offset for each usage.
## EXAMPLES
### EXAMPLE 1
The following example finds **AzureRM** PowerShell command references in the specified file.
```powershell
Find-AzUpgradeCommandReference -FilePath 'C:\Scripts\test.ps1' -AzureRmVersion '6.13.1'
```
### EXAMPLE 2
Find-AzUpgradeCommandReference -DirectoryPath 'C:\Scripts' -AzureRmVersion '6.13.1'
```
The following example finds AzureRM PowerShell command references in the specified directory and subfolders.
```
### EXAMPLE 3
The following example finds **AzureRM** PowerShell command references in the specified directory and
subfolders but with a pre-loaded module specification. This is helpful to avoid reloading the module
specification if the `Find-AzUpgradeCommandReference` command needs to be executed several times.
```powershell
$moduleSpec = Get-AzUpgradeCmdletSpec -AzureRM
Find-AzUpgradeCommandReference -DirectoryPath 'C:\Scripts1' -AzureRmModuleSpec $moduleSpec
Find-AzUpgradeCommandReference -DirectoryPath 'C:\Scripts2' -AzureRmModuleSpec $moduleSpec
Find-AzUpgradeCommandReference -DirectoryPath 'C:\Scripts3' -AzureRmModuleSpec $moduleSpec
```
## PARAMETERS
### -AzureRmModuleSpec
Specifies a dictionary containing cmdlet specification objects, returned from
`Get-AzUpgradeCmdletSpec`.
```yaml
Type: System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]
Parameter Sets: ByFileAndModuleSpec, ByDirectoryAndModuleSpec
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AzureRmVersion
Specifies the **AzureRM** module version used in your existing PowerShell file(s) or modules.
```yaml
Type: System.String
Parameter Sets: ByFileAndModuleVersion, ByDirectoryAndModuleVersion
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DirectoryPath
Specifies the path to the folder where PowerShell scripts or modules reside.
```yaml
Type: System.String
Parameter Sets: ByDirectoryAndModuleSpec, ByDirectoryAndModuleVersion
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -FilePath
Specifies the path to a single PowerShell file.
```yaml
Type: System.String
Parameter Sets: ByFileAndModuleSpec, ByFileAndModuleVersion
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

Просмотреть файл

@ -0,0 +1,64 @@
---
external help file: Az.Tools.Migration-help.xml
Module Name: az.tools.migration
online version:
schema: 2.0.0
---
# Get-AzUpgradeAliasSpec
## SYNOPSIS
Returns a dictionary containing cmdlet alias mappings for the specified **Az** module version.
## SYNTAX
```
Get-AzUpgradeAliasSpec [-ModuleVersion] <String> [<CommonParameters>]
```
## DESCRIPTION
Returns a dictionary containing cmdlet alias mappings for the specified **Az** module version.
## EXAMPLES
### EXAMPLE 1
Returns the cmdlet alias mappings table for latest Az version.
```powershell
Get-AzUpgradeAliasSpec -ModuleVersion latest
```
## PARAMETERS
### -ModuleVersion
Specify the version of the module to import command aliases from.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

Просмотреть файл

@ -0,0 +1,104 @@
---
external help file: Az.Tools.Migration-help.xml
Module Name: az.tools.migration
online version:
schema: 2.0.0
---
# Get-AzUpgradeCmdletSpec
## SYNOPSIS
Returns a dictionary containing cmdlet specification objects for the specified module.
## SYNTAX
### AzureRM
```
Get-AzUpgradeCmdletSpec [-AzureRM] [<CommonParameters>]
```
### Az
```
Get-AzUpgradeCmdletSpec [-Az] -ModuleVersion <String> [<CommonParameters>]
```
## DESCRIPTION
Returns a dictionary containing cmdlet specification objects for the specified module.
## EXAMPLES
### EXAMPLE 1
Returns the dictionary containing cmdlet specification objects for **AzureRM** 6.13.1.
```powershell
Get-AzUpgradeCmdletSpec -AzureRM
```
## PARAMETERS
### -Az
Import command definitions from Az modules.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: Az
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -AzureRM
Import command definitions from **AzureRM** modules.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: AzureRM
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -ModuleVersion
Specify the version of the module to load command definitions from.
```yaml
Type: System.String
Parameter Sets: Az
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

Просмотреть файл

@ -0,0 +1,157 @@
---
external help file: Az.Tools.Migration-help.xml
Module Name: az.tools.migration
online version:
schema: 2.0.0
---
# Invoke-AzUpgradeModulePlan
## SYNOPSIS
Invokes the specified module upgrade plan.
## SYNTAX
```
Invoke-AzUpgradeModulePlan [-Plan] <UpgradePlan[]> [-FileEditMode] <EditMode> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Invokes the specified module upgrade plan.
> [!IMPORTANT]
> This step is destructive if the **FileEditMode** parameter is set to `ModifyExistingFiles`. This
> mode makes file edits in place according to the module upgrade plan. There is no undo operation.
> Always ensure that you have a backup copy of the target PowerShell script or module.
To save the upgraded script contents into new files, leaving the originals unmodified, specify
`SaveChangesToNewFiles` with the **FileEditMode** parameter.
The upgrade plan is generated by running the `New-AzUpgradeModulePlan` cmdlet.
## EXAMPLES
### EXAMPLE 1
The following example invokes the upgrade plan for a PowerShell module named **myModule** and saves
the updated file contents into new files, leaving the original files unmodified.
```powershell
# step 1: generate a plan and save it to a variable.
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion latest -DirectoryPath 'C:\Scripts\myModule'
# step 2: write the plan to the console to review the upgrade steps, warnings, and errors.
$plan
# step 3: run the automatic upgrade plan (saving updated scripts to new files) and collects the results in a variable.
$results = Invoke-AzUpgradeModulePlan -Plan $Plan -FileEditMode SaveChangesToNewFiles
# step 4: write the upgrade results to the console to review the result for each upgrade step.
$results
```
### EXAMPLE 2
The following example invokes the upgrade plan for a PowerShell module named **myModule** and
modifies the existing files in place.
```powershell
# step 1: generate a plan and save it to a variable.
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion latest -DirectoryPath 'C:\Scripts\myModule'
# step 2: write the plan to the console to review the upgrade steps, warnings, and errors.
$plan
# step 3: run the automatic upgrade plan (modifying the files in place) and collects the results in a variable.
$results = Invoke-AzUpgradeModulePlan -Plan $Plan -FileEditMode ModifyExistingFiles
# step 4: write the upgrade results to the console to review the result for each upgrade step.
$results
```
## PARAMETERS
### -FileEditMode
Specifies the file edit mode to determine if the upgrade plan should be executed in place, modifies
existing files, or if changes should be saved to new files. Specify `ModifyExistingFiles` to modify
your script files in place, or `SaveChangesToNewFiles` to save new PowerShell files, leaving your
existing files unmodified.
```yaml
Type: EditMode
Parameter Sets: (All)
Aliases:
Accepted values: ModifyExistingFiles, SaveChangesToNewFiles
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Plan
Specifies the upgrade plan steps to execute. This is generated from `New-AzUpgradeModulePlan`.
```yaml
Type: UpgradePlan[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

Просмотреть файл

@ -0,0 +1,248 @@
---
external help file: Az.Tools.Migration-help.xml
Module Name: az.tools.migration
online version:
schema: 2.0.0
---
# New-AzUpgradeModulePlan
## SYNOPSIS
Generates a new upgrade plan for migrating to the **Az** PowerShell module.
## SYNTAX
### FromReferences
```
New-AzUpgradeModulePlan -AzureRmCmdReference <CommandReference[]> -ToAzVersion <String>
[-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzAliasMappingSpec <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[<CommonParameters>]
```
### FromNewSearchByDirectory
```
New-AzUpgradeModulePlan -FromAzureRmVersion <String> -DirectoryPath <String> -ToAzVersion <String>
[-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzAliasMappingSpec <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[<CommonParameters>]
```
### FromNewSearchByFile
```
New-AzUpgradeModulePlan -FromAzureRmVersion <String> -FilePath <String> -ToAzVersion <String>
[-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzAliasMappingSpec <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[<CommonParameters>]
```
## DESCRIPTION
Generates a new upgrade plan for migrating to the **Az** PowerShell module. The upgrade plan details
the specific file/offset points that require changes when moving from **AzureRM** commands to Az
commands.
## EXAMPLES
### EXAMPLE 1
The following example generates a new **Az** module upgrade plan for the script file
`C:\Scripts\my-azure-script.ps1`.
```powershell
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion latest -FilePath 'C:\Scripts\my-azure-script.ps1'
```
### EXAMPLE 2
The following example generates a new **Az** module upgrade plan for the script and module files
located under `C:\Scripts`.
```powershell
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion latest -DirectoryPath 'C:\Scripts'
```
### EXAMPLE 3
The following example generates a new **Az** module upgrade plan for the script and module files
under `C:\Scripts`.
```powershell
$references = Find-AzUpgradeCommandReference -DirectoryPath 'C:\Scripts' -AzureRmVersion '6.13.1'
New-AzUpgradeModulePlan -ToAzVersion latest -AzureRmCmdReference $references
```
### EXAMPLE 4
The following example generates a new **Az** module upgrade plan for the script and module files
under several directories. Module specs are pre-loaded here to avoid re-loading the spec each time a
plan is generated.
```powershell
# pre-load specifications
$armSpec = Get-AzUpgradeCmdletSpec -AzureRM
$azSpec = Get-AzUpgradeCmdletSpec -Az -ModuleVersion latest
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion latest
# execute a batch of module upgrades
$plan1 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts1' -FromAzureRmVersion '6.13.1' -ToAzVersion latest -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan2 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts2' -FromAzureRmVersion '6.13.1' -ToAzVersion latest -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan3 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts3' -FromAzureRmVersion '6.13.1' -ToAzVersion latest -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
```
## PARAMETERS
### -AzAliasMappingSpec
Specifies an optional parameter to provide a pre-loaded Az cmdlet alias mapping table, returned from
`Get-AzUpgradeAliasSpec`.
```yaml
Type: System.Collections.Generic.Dictionary`2[System.String,System.String]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AzModuleSpec
Specifies an optional parameter to provide a pre-loaded **Az** module spec, returned from
`Get-AzUpgradeCmdletSpec`.
```yaml
Type: System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AzureRmCmdReference
Specifies the **AzureRM** command references output from the `Find-AzUpgradeCommandReference`
cmdlet.
```yaml
Type: CommandReference[]
Parameter Sets: FromReferences
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AzureRmModuleSpec
Specifies an optional parameter to provide a pre-loaded **AzureRM** module spec, returned from
`Get-AzUpgradeCmdletSpec`.
```yaml
Type: System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DirectoryPath
Specifies the path to a folder where PowerShell scripts or modules reside.
```yaml
Type: System.String
Parameter Sets: FromNewSearchByDirectory
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -FilePath
Specifies the path to a single PowerShell file.
```yaml
Type: System.String
Parameter Sets: FromNewSearchByFile
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -FromAzureRmVersion
Specifies the **AzureRM** module version used in your existing PowerShell scripts(s) or modules.
```yaml
Type: System.String
Parameter Sets: FromNewSearchByDirectory, FromNewSearchByFile
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ToAzVersion
Specifies the **Az** module version to upgrade to. Currently, only Az version 10.3 is supported.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS