From efcfed259e762db5d85fbffee21dce845592b80c Mon Sep 17 00:00:00 2001 From: "Lucas Yao (Wicresoft North America)" Date: Thu, 18 Jun 2020 11:29:05 +0800 Subject: [PATCH 1/4] Fix issue #12200: example of New-AzImageBuilderCustomizerObject needs to remove Sha256Checksum parameter. --- src/ImageBuilder/docs/Az.ImageBuilder.md | 2 +- .../New-AzImageBuilderCustomizerObject.md | 25 +++++++++++-------- src/ImageBuilder/docs/readme.md | 4 +-- .../New-AzImageBuilderCustomizerObject.md | 21 ++++++++-------- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/ImageBuilder/docs/Az.ImageBuilder.md b/src/ImageBuilder/docs/Az.ImageBuilder.md index dd936831cfe6..3c8f683eea16 100644 --- a/src/ImageBuilder/docs/Az.ImageBuilder.md +++ b/src/ImageBuilder/docs/Az.ImageBuilder.md @@ -1,6 +1,6 @@ --- Module Name: Az.ImageBuilder -Module Guid: bdedc683-d9b6-41ea-b310-d068b8c72305 +Module Guid: e90b2588-5031-43ea-81b5-9a419d2fec07 Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.imagebuilder Help Version: 1.0.0.0 Locale: en-US diff --git a/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md b/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md index 19b063a51bbd..a8a72edd1945 100644 --- a/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md +++ b/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md @@ -61,11 +61,11 @@ This command creates a windows update customizer. ### Example 2: Create a file customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Sha256Checksum 'ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' +PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' -Name Type Destination Sha256Checksum SourceUri ----- ---- ----------- -------------- --------- -filecus File c:\\buildArtifacts\\index.html ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html +Name Type Destination Sha256Checksum SourceUri +---- ---- ----------- -------------- --------- +filecus File c:\\buildArtifacts\\index.html https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/… ``` @@ -73,14 +73,17 @@ This command creates a file customizer. ### Example 3: Create a powershell customizer ```powershell -PS C:\> $inline = @("mkdir c:\\buildActions", "echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt") -PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 -Inline $inline -Name Type Inline RunElevated ScriptUri Sha256Checksum ValidExitC e ----- ---- ------ ----------- --------- -------------- -- -settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 ``` +```powershell +PS C:\\> $inline = @("mkdir c:\\buildActions", "echo Azure-Image-Builder-Was-Here \> c:\\buildActions\\buildActionsOutput.txt") +PS C:\\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Inline $inline + +Name Type Inline RunElevated ScriptUri Sha256Checksum +---- ---- ------ ----------- --------- -------------- +settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here \> c:\\buildActions\\buildActionsOutput.txt} False + This command creates a powershell customizer. ### Example 4: Create a restart customizer @@ -96,11 +99,11 @@ This command creates a restart customizer. ### Example 5: Create a shell customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" Name Type Inline ScriptUri Sha256Checksum ---- ---- ------ --------- -------------- -downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ``` This command creates a shell customizer. diff --git a/src/ImageBuilder/docs/readme.md b/src/ImageBuilder/docs/readme.md index 031fc4278b6e..b1ccd15f1fd7 100644 --- a/src/ImageBuilder/docs/readme.md +++ b/src/ImageBuilder/docs/readme.md @@ -1,5 +1,5 @@ # Docs -This directory contains the documentation of the cmdlets for the `Az.ImageBuilder` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `..\examples` folder. +This directory contains the documentation of the cmdlets for the `Az.ImageBuilder` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `../examples` folder. ## Info - Modifiable: no @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.ImageBuilde - Packaged: yes ## Details -The process of documentation generation loads `Az.ImageBuilder` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.ImageBuilder` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md b/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md index d5b461385900..17be84a2852d 100644 --- a/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md +++ b/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md @@ -11,11 +11,11 @@ This command creates a windows update customizer. ### Example 2: Create a file customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Sha256Checksum 'ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' +PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' -Name Type Destination Sha256Checksum SourceUri ----- ---- ----------- -------------- --------- -filecus File c:\\buildArtifacts\\index.html ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html +Name Type Destination Sha256Checksum SourceUri +---- ---- ----------- -------------- --------- +filecus File c:\\buildArtifacts\\index.html https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/… ``` @@ -24,12 +24,11 @@ This command creates a file customizer. ### Example 3: Create a powershell customizer ```powershell PS C:\> $inline = @("mkdir c:\\buildActions", "echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt") -PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 -Inline $inline +PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Inline $inline -Name Type Inline RunElevated ScriptUri Sha256Checksum ValidExitC e ----- ---- ------ ----------- --------- -------------- -- -settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 -``` +Name Type Inline RunElevated ScriptUri Sha256Checksum +---- ---- ------ ----------- --------- -------------- +settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False This command creates a powershell customizer. @@ -46,11 +45,11 @@ This command creates a restart customizer. ### Example 5: Create a shell customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" Name Type Inline ScriptUri Sha256Checksum ---- ---- ------ --------- -------------- -downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ``` This command creates a shell customizer. From 71dd34fb52a2ca8e3fd8bc7ea19c5ebd17d8c08f Mon Sep 17 00:00:00 2001 From: "Lucas Yao (Wicresoft North America)" Date: Thu, 18 Jun 2020 11:40:12 +0800 Subject: [PATCH 2/4] example of New-AzImageBuilderCustomizerObject needs to remove Sha256Checksum parameter. --- src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md b/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md index 17be84a2852d..36061b99e894 100644 --- a/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md +++ b/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md @@ -30,6 +30,8 @@ Name Type Inline ---- ---- ------ ----------- --------- -------------- settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False +``` + This command creates a powershell customizer. ### Example 4: Create a restart customizer From 730fcbd67f7e1ce7405d282556961b9eea00f0b5 Mon Sep 17 00:00:00 2001 From: "Lucas Yao (Wicresoft North America)" Date: Thu, 18 Jun 2020 13:57:28 +0800 Subject: [PATCH 3/4] Fix New-AzImageBuilderCustomizerObject.md. --- src/ImageBuilder/custom/Az.ImageBuilder.custom.psm1 | 4 ++-- src/ImageBuilder/custom/readme.md | 8 ++++---- .../docs/New-AzImageBuilderCustomizerObject.md | 12 +++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/ImageBuilder/custom/Az.ImageBuilder.custom.psm1 b/src/ImageBuilder/custom/Az.ImageBuilder.custom.psm1 index 66de7b0c120e..869388fa986e 100644 --- a/src/ImageBuilder/custom/Az.ImageBuilder.custom.psm1 +++ b/src/ImageBuilder/custom/Az.ImageBuilder.custom.psm1 @@ -1,9 +1,9 @@ # region Generated # Load the private module dll - $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ImageBuilder.private.dll') + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.ImageBuilder.private.dll') # Load the internal module - $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ImageBuilder.internal.psm1' + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.ImageBuilder.internal.psm1' if(Test-Path $internalModulePath) { $null = Import-Module -Name $internalModulePath } diff --git a/src/ImageBuilder/custom/readme.md b/src/ImageBuilder/custom/readme.md index b896468e0e44..54e3f6e547ba 100644 --- a/src/ImageBuilder/custom/readme.md +++ b/src/ImageBuilder/custom/readme.md @@ -1,5 +1,5 @@ # Custom -This directory contains custom implementation for non-generated cmdlets for the `Az.ImageBuilder` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.ImageBuilder.custom.psm1`. This file should not be modified. +This directory contains custom implementation for non-generated cmdlets for the `Az.ImageBuilder` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.ImageBuilder.custom.psm1`. This file should not be modified. ## Info - Modifiable: yes @@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle For script cmdlets, these are loaded via the `Az.ImageBuilder.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. ## Purpose -This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. ## Usage -The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: - Break - DefaultProfile - HttpPipelineAppend @@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes: - `Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Models.DoNotExportAttribute` - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.ImageBuilder`. - `Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Models.InternalExportAttribute` - - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.ImageBuilder`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder. + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.ImageBuilder`. For more information, see [readme.md](../internal/readme.md) in the `../internal` folder. - `Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Models.ProfileAttribute` - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md b/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md index a8a72edd1945..c72a96171086 100644 --- a/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md +++ b/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md @@ -73,16 +73,14 @@ This command creates a file customizer. ### Example 3: Create a powershell customizer ```powershell - -``` - -```powershell -PS C:\\> $inline = @("mkdir c:\\buildActions", "echo Azure-Image-Builder-Was-Here \> c:\\buildActions\\buildActionsOutput.txt") -PS C:\\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Inline $inline +PS C:\> $inline = @("mkdir c:\\buildActions", "echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt") +PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Inline $inline Name Type Inline RunElevated ScriptUri Sha256Checksum ---- ---- ------ ----------- --------- -------------- -settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here \> c:\\buildActions\\buildActionsOutput.txt} False +settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False + +``` This command creates a powershell customizer. From c78b3189e7dadf3167c7ad5dbfc5779ecf812bb5 Mon Sep 17 00:00:00 2001 From: "Lucas Yao (Wicresoft North America)" Date: Mon, 22 Jun 2020 14:12:07 +0800 Subject: [PATCH 4/4] Remove Sha256Checksum parameter of example of New-AzImageBuilderCustomizerObject. --- .../New-AzImageBuilderCustomizerObject.md | 21 ++++++++++--------- .../New-AzImageBuilderCustomizerObject.md | 21 ++++++++++--------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md b/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md index 19b063a51bbd..c72a96171086 100644 --- a/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md +++ b/src/ImageBuilder/docs/New-AzImageBuilderCustomizerObject.md @@ -61,11 +61,11 @@ This command creates a windows update customizer. ### Example 2: Create a file customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Sha256Checksum 'ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' +PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' -Name Type Destination Sha256Checksum SourceUri ----- ---- ----------- -------------- --------- -filecus File c:\\buildArtifacts\\index.html ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html +Name Type Destination Sha256Checksum SourceUri +---- ---- ----------- -------------- --------- +filecus File c:\\buildArtifacts\\index.html https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/… ``` @@ -74,11 +74,12 @@ This command creates a file customizer. ### Example 3: Create a powershell customizer ```powershell PS C:\> $inline = @("mkdir c:\\buildActions", "echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt") -PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 -Inline $inline +PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Inline $inline + +Name Type Inline RunElevated ScriptUri Sha256Checksum +---- ---- ------ ----------- --------- -------------- +settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False -Name Type Inline RunElevated ScriptUri Sha256Checksum ValidExitC e ----- ---- ------ ----------- --------- -------------- -- -settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 ``` This command creates a powershell customizer. @@ -96,11 +97,11 @@ This command creates a restart customizer. ### Example 5: Create a shell customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" Name Type Inline ScriptUri Sha256Checksum ---- ---- ------ --------- -------------- -downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ``` This command creates a shell customizer. diff --git a/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md b/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md index d5b461385900..36061b99e894 100644 --- a/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md +++ b/src/ImageBuilder/examples/New-AzImageBuilderCustomizerObject.md @@ -11,11 +11,11 @@ This command creates a windows update customizer. ### Example 2: Create a file customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Sha256Checksum 'ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' +PS C:\> New-AzImageBuilderCustomizerObject -FileCustomizer -CustomizerName 'filecus' -Destination 'c:\\buildArtifacts\\index.html' -SourceUri 'https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html' -Name Type Destination Sha256Checksum SourceUri ----- ---- ----------- -------------- --------- -filecus File c:\\buildArtifacts\\index.html ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html +Name Type Destination Sha256Checksum SourceUri +---- ---- ----------- -------------- --------- +filecus File c:\\buildArtifacts\\index.html https://github.com/danielsollondon/azvmimagebuilder/blob/master/quickquickstarts/exampleArtifacts/buildArtifacts/… ``` @@ -24,11 +24,12 @@ This command creates a file customizer. ### Example 3: Create a powershell customizer ```powershell PS C:\> $inline = @("mkdir c:\\buildActions", "echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt") -PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 -Inline $inline +PS C:\> New-AzImageBuilderCustomizerObject -PowerShellCustomizer -CustomizerName settingUpMgmtAgtPath -RunElevated $false -Inline $inline + +Name Type Inline RunElevated ScriptUri Sha256Checksum +---- ---- ------ ----------- --------- -------------- +settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False -Name Type Inline RunElevated ScriptUri Sha256Checksum ValidExitC e ----- ---- ------ ----------- --------- -------------- -- -settingUpMgmtAgtPath PowerShell {mkdir c:\\buildActions, echo Azure-Image-Builder-Was-Here > c:\\buildActions\\buildActionsOutput.txt} False ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 ``` This command creates a powershell customizer. @@ -46,11 +47,11 @@ This command creates a restart customizer. ### Example 5: Create a shell customizer ```powershell -PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" -Sha256Checksum ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +PS C:\> New-AzImageBuilderCustomizerObject -ShellCustomizer -CustomizerName downloadBuildArtifacts -ScriptUri "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh" Name Type Inline ScriptUri Sha256Checksum ---- ---- ------ --------- -------------- -downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ade4c5214c3c675e92c66e2d067a870c5b81b9844b3de3cc72c49ff36425fc93 +downloadBuildArtifacts Shell https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/customizeScript2.sh ``` This command creates a shell customizer.