From 48e89100460f108d5b80aa8e6abc93c831848231 Mon Sep 17 00:00:00 2001 From: Sinisa Sokolic Date: Thu, 4 Apr 2024 16:33:38 +0200 Subject: [PATCH 1/4] fix: adjusted documents to match markdown rules --- LICENSE | 2 +- Readme.md | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 705ff82..0f09c34 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -MIT License +# MIT License Copyright (c) 2024 XOAP.io diff --git a/Readme.md b/Readme.md index 33fe5b8..8f0c243 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,9 @@ # Introduction -This repository hosts scripts for the Scripted Actions area, which is part of the [XOAP platform](https://xoap.io). They are provided as-is and are not officially supported by XOAP. Use them at your own risk. Always test them in a non-production environment before using them in production. +This repository hosts scripts for the Scripted Actions area, which is part of +the [XOAP platform](https://xoap.io). They are provided as-is and are not +officially supported by XOAP. Use them at your own risk. Always test them in a +non-production environment before using them in production. ## Code of Conduct @@ -14,19 +17,24 @@ A full list of changes in each version can be found in the [Releases](https://g ### Azure CLI & Bicep -Most of the available scripts are built to use a local Azure CLI configuration file. Find more information here: [Azure CLI Configuration](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration). +Most of the available scripts are built to use a local Azure CLI configuration +file. Find more information here: [Azure CLI Configuration](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration). ### Azure PowerShell -For Azure PowerShell-related scripts we suggest to use the noninteractive authentication with a service principal: [Sign in to Azure PowerShell with a service principal](https://learn.microsoft.com/en-us/powershell/azure/authenticate-noninteractive?view=azps-11.4.0). +For Azure PowerShell-related scripts we suggest using the noninteractive +authentication with a service principal: +[Sign in to Azure PowerShell with a service principal](https://learn.microsoft.com/en-us/powershell/azure/authenticate-noninteractive?view=azps-11.4.0). ### AWS CLI -For AWS CLI-related scripts we suggest using the AWS CLI configuration file: [Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). +For AWS CLI-related scripts we suggest using the AWS CLI configuration file: +[Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). ## Prerequisites -Depending on which scripts you want to use, you need to have the following prerequisites installed: +Depending on which scripts you want to use, you need to have the following +prerequisites installed: ### Azure CLI @@ -50,5 +58,5 @@ See Azure CLI & Azure PowerShell. ## Templates -You can use the provided templates to create your scripts. The templates are located in the `templates` folder. - +You can use the provided templates to create your scripts. +The templates are located in the `templates` folder. From 703f920eb0720585448d818ac2562b54050cc15e Mon Sep 17 00:00:00 2001 From: Sinisa Sokolic Date: Tue, 23 Apr 2024 18:11:33 +0200 Subject: [PATCH 2/4] script adjustments, added action preference stop everywhere --- aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 | 2 +- aws-cli/ec2/aws-cli-create-ec2-instance.ps1 | 3 +- aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 | 2 +- aws-cli/ec2/aws-cli-start-instance.ps1 | 2 +- aws-cli/ec2/aws-cli-stop-instance.ps1 | 2 +- aws-cli/ec2/aws-cli-terminate-instance.ps1 | 2 +- aws-cli/network/aws-cli-create-subnet.ps1 | 2 +- .../organizations/aws-cli-create-account.ps1 | 2 +- .../aws-cli-authorize-ec2-security-group | 2 +- .../aws-cli-create-ec2-security-group.ps1 | 2 +- .../aws-cli-delete-ec2-security-group.ps1 | 2 +- aws-cli/storage/aws-cli-create-s3-bucket.ps1 | 2 +- aws-cli/workspaces/aws-cli-create-tag.ps1 | 2 +- aws-cli/workspaces/aws-cli-delete-tag.ps1 | 2 +- ...aws-cli-deregister-workspace-directory.ps1 | 2 +- .../workspaces/aws-cli-migrate-workspace.ps1 | 2 +- .../aws-cli-modify-workspace-state.ps1 | 2 +- .../workspaces/aws-cli-reboot-workspace.ps1 | 2 +- .../workspaces/aws-cli-rebuild-workspace.ps1 | 2 +- .../aws-cli-register-workspace-directory.ps1 | 2 +- .../workspaces/aws-cli-restore-workspace.ps1 | 2 +- .../workspaces/aws-cli-start-workspace.ps1 | 2 +- aws-cli/workspaces/aws-cli-stop-worksapce.ps1 | 2 +- .../aws-cli-terminate-workspace.ps1 | 2 +- .../wip_aws-cli-create-workspace.ps1 | 4 +- ...i-modify-workspace-creation-properties.ps1 | 2 +- ...ip_aws-cli-modify-workspace-properties.ps1 | 2 +- aws-cli/xoap/aws-cli-register-node.ps1 | 2 +- aws-ps/connect/wip_set-awscredential.ps1 | 2 +- aws-ps/workspaces/aws-ps-create-workspace.ps1 | 2 +- aws-ps/workspaces/aws-ps-reboot-workspace.ps1 | 2 +- azure-cli/arm/az-cli-deploy-arm.ps1 | 2 +- .../az-cli-create-avd-application-group.ps1 | 2 +- azure-cli/avd/az-cli-create-avd-workspace.ps1 | 2 +- azure-cli/avd/az-cli-update-avd-hostpool.ps1 | 2 +- .../avd/wip_az-cli-create-avd-hostpool.ps1 | 159 +++++++++++++----- .../wip_az-cli-avd-accelerator-baseline.ps1 | 138 +++++++++++++++ ...-bicep.ps1 => wip_az-cli-deploy-bicep.ps1} | 2 +- .../network/az-cli-create-virtual-network.ps1 | 2 +- .../az-cli-create-resource-group.ps1 | 3 +- .../az-cli-delete-resource-group.ps1 | 4 +- azure-cli/security/wip_az-cli-create-nsg.ps1 | 2 +- .../storage/az-cli-create-storage-account.ps1 | 3 +- .../vms/az-cli-create-image-definition.ps1 | 36 ++-- azure-cli/vms/az-cli-create-image-gallery.ps1 | 7 +- azure-cli/vms/az-cli-create-image-version.ps1 | 18 +- azure-cli/vms/az-cli-create-vm-scale-set.ps1 | 10 +- azure-cli/vms/az-cli-create-windows-vm.ps1 | 14 +- .../az-cli-delete-image-builder-windows.ps1 | 14 +- .../az-cli-enable-EntraID-login-linux-vm.ps1 | 10 +- azure-cli/vms/az-cli-install-webserver-vm.ps1 | 6 +- azure-cli/vms/az-cli-share-image-gallery.ps1 | 8 +- .../wip_az-cli-create-image-builder-linux.ps1 | 5 +- ...ip_az-cli-create-image-builder-windows.ps1 | 5 +- azure-cli/vms/wip_az-cli-create-linux-vm.ps1 | 5 +- .../vms/wip_az-cli-create-specialized-vm.ps1 | 5 +- .../wip_az-cli-delete-image-builder-linux.ps1 | 5 +- azure-cli/xoap/az-cli-register-node.ps1 | 8 +- azure-ps/avd/az-ps-create-avd-workspace.ps1 | 13 +- .../avd/az-ps-disconnect-avd-user-session.ps1 | 10 +- azure-ps/az-ps-create-linux-vm.ps1 | 3 +- azure-ps/az-ps-create-resource-group.ps1 | 3 +- azure-ps/az-ps-create-vm-scale-set.ps1 | 3 +- azure-ps/az-ps-delete-resource-group.ps1 | 4 +- .../az-ps-image-builder-windows-cleanup.ps1 | 2 +- azure-ps/az-ps-install-nginx-linux-vm.ps1 | 2 +- azure-ps/az-ps-install-webserver-windows.ps1 | 2 +- azure-ps/bicep/az-ps-deploy-bicep.ps1 | 2 +- azure-ps/wip_az-ps-create-image-avd.ps1 | 2 +- azure-ps/wip_az-ps-create-windows-vm.ps1 | 3 +- azure-ps/wip_az-ps-image-builder-windows.ps1 | 2 +- templates/template.ps1 | 2 +- 72 files changed, 412 insertions(+), 183 deletions(-) create mode 100644 azure-cli/bicep/wip_az-cli-avd-accelerator-baseline.ps1 rename azure-cli/bicep/{az-cli-deploy-bicep.ps1 => wip_az-cli-deploy-bicep.ps1} (97%) diff --git a/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 b/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 index 09caa1b..e0798a5 100644 --- a/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 +++ b/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 @@ -39,7 +39,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 associate-address ` diff --git a/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 b/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 index 1c403c9..2e0996e 100644 --- a/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 +++ b/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 @@ -50,6 +50,7 @@ param( [Parameter(Mandatory)] [int]$AwsInstanceCount, [Parameter(Mandatory)] + [ValidateSet('t2.micro', 't2.small', 't2.medium', 't2.large', 'm4.large', 'm4.xlarge', 'm4.2xlarge', 'm4.4xlarge', 'm4.10xlarge', 'm4.16xlarge', 'm5.large', 'm5.xlarge', 'm5.2xlarge', 'm5.4xlarge', 'm5.12xlarge', 'm5.24xlarge', 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', 'c4.large', 'c4.xlarge', 'c4.2xlarge', 'c4.4xlarge', 'c4.8xlarge', 'c5.large', 'c5.xlarge', 'c5.2xlarge', 'c5.4xlarge', 'c5.9xlarge', 'c5.18xlarge', 'c5d.large', 'c5d.xlarge', 'c5d.2xlarge', 'c5d.4xlarge', 'c5d.9xlarge', 'c5d.18xlarge', 'r4.large', 'r4.xlarge', 'r4.2xlarge', 'r4.4xlarge', 'r4.8xlarge', 'r4.16xlarge', 'r5.large', 'r5.xlarge', 'r5.2xlarge', 'r5.4xlarge', 'r5.12xlarge', 'r5.24xlarge', 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', 'i3.large', 'i3.xlarge', 'i3.2xlarge', 'i3.4xlarge', 'i3.8xlarge', 'i3.16xlarge', 'i3en.large', 'i3en.xlarge', 'i3en.2xlarge', 'i3en.3xlarge')] [string]$AwsInstanceType, [Parameter(Mandatory)] [string]$AwsKeyPairName, @@ -58,7 +59,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 run-instances ` diff --git a/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 b/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 index 834d68a..5f42af4 100644 --- a/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 +++ b/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 @@ -36,7 +36,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 create-key-pair ` --key-name $AwsKeyPairName ` diff --git a/aws-cli/ec2/aws-cli-start-instance.ps1 b/aws-cli/ec2/aws-cli-start-instance.ps1 index 4a77427..7876a7c 100644 --- a/aws-cli/ec2/aws-cli-start-instance.ps1 +++ b/aws-cli/ec2/aws-cli-start-instance.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 start-instances ` diff --git a/aws-cli/ec2/aws-cli-stop-instance.ps1 b/aws-cli/ec2/aws-cli-stop-instance.ps1 index 2ac7013..751e80c 100644 --- a/aws-cli/ec2/aws-cli-stop-instance.ps1 +++ b/aws-cli/ec2/aws-cli-stop-instance.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 stop-instances ` --instance-ids $AwsInstanceId diff --git a/aws-cli/ec2/aws-cli-terminate-instance.ps1 b/aws-cli/ec2/aws-cli-terminate-instance.ps1 index ec26f2d..094e67e 100644 --- a/aws-cli/ec2/aws-cli-terminate-instance.ps1 +++ b/aws-cli/ec2/aws-cli-terminate-instance.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 terminate-instances ` --instance-ids $AwsInstanceId diff --git a/aws-cli/network/aws-cli-create-subnet.ps1 b/aws-cli/network/aws-cli-create-subnet.ps1 index bfd824d..46d3929 100644 --- a/aws-cli/network/aws-cli-create-subnet.ps1 +++ b/aws-cli/network/aws-cli-create-subnet.ps1 @@ -50,7 +50,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 create-subnet ` --vpc-id $AwsVpcId ` diff --git a/aws-cli/organizations/aws-cli-create-account.ps1 b/aws-cli/organizations/aws-cli-create-account.ps1 index bfdb794..f4799f2 100644 --- a/aws-cli/organizations/aws-cli-create-account.ps1 +++ b/aws-cli/organizations/aws-cli-create-account.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws organizations create-account ` --email $AwsAccountEmail ` diff --git a/aws-cli/security/aws-cli-authorize-ec2-security-group b/aws-cli/security/aws-cli-authorize-ec2-security-group index 852c50f..3544271 100644 --- a/aws-cli/security/aws-cli-authorize-ec2-security-group +++ b/aws-cli/security/aws-cli-authorize-ec2-security-group @@ -51,7 +51,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 authorize-security-group-ingress ` --group-id $AwsSecurityGroupId ` diff --git a/aws-cli/security/aws-cli-create-ec2-security-group.ps1 b/aws-cli/security/aws-cli-create-ec2-security-group.ps1 index c70cb42..3f61b65 100644 --- a/aws-cli/security/aws-cli-create-ec2-security-group.ps1 +++ b/aws-cli/security/aws-cli-create-ec2-security-group.ps1 @@ -45,7 +45,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 create-security-group ` --group-name $AwsSecurityGroupName ` diff --git a/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 b/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 index c165deb..fc10d5b 100644 --- a/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 +++ b/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws ec2 delete-security-group ` --group-id $AwsSecurityGroupId diff --git a/aws-cli/storage/aws-cli-create-s3-bucket.ps1 b/aws-cli/storage/aws-cli-create-s3-bucket.ps1 index 5a852e6..26f5277 100644 --- a/aws-cli/storage/aws-cli-create-s3-bucket.ps1 +++ b/aws-cli/storage/aws-cli-create-s3-bucket.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws s3api create-bucket ` --bucket $AwsBucketName ` diff --git a/aws-cli/workspaces/aws-cli-create-tag.ps1 b/aws-cli/workspaces/aws-cli-create-tag.ps1 index b21103a..7da5f7c 100644 --- a/aws-cli/workspaces/aws-cli-create-tag.ps1 +++ b/aws-cli/workspaces/aws-cli-create-tag.ps1 @@ -37,7 +37,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces create-tags ` --resource-id $AwsWorkspaceId ` diff --git a/aws-cli/workspaces/aws-cli-delete-tag.ps1 b/aws-cli/workspaces/aws-cli-delete-tag.ps1 index 4ce3da9..687091a 100644 --- a/aws-cli/workspaces/aws-cli-delete-tag.ps1 +++ b/aws-cli/workspaces/aws-cli-delete-tag.ps1 @@ -38,7 +38,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces delete-tags ` --resource-id $AwsWorkspaceId ` diff --git a/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 b/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 index cb517a6..8a9a4c0 100644 --- a/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 +++ b/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces deregister-workspace-directory ` --directory-id $AwsDirectoryId diff --git a/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 b/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 index 17a5716..c150e9e 100644 --- a/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces migrate-workspace ` --source-workspace-id $AwsSourceWorkspaceId ` diff --git a/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 b/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 index adc3c4e..a406f40 100644 --- a/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 +++ b/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces modify-workspace-state ` --workspace-id $AwsWorkspaceId ` diff --git a/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 b/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 index 37e3a5e..0b6789e 100644 --- a/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces reboot-workspaces ` --reboot-workspace-requests $AwsWorkspaceId diff --git a/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 b/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 index 9904b6d..1451040 100644 --- a/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces rebuild-workspaces ` --rebuild-workspace-requests $AwsWorkspaceId diff --git a/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 b/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 index b103f4c..3f1a964 100644 --- a/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 +++ b/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 @@ -34,7 +34,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces register-workspace-directory ` --directory-id $AwsDirectoryId ` diff --git a/aws-cli/workspaces/aws-cli-restore-workspace.ps1 b/aws-cli/workspaces/aws-cli-restore-workspace.ps1 index 9ca059c..4cf2933 100644 --- a/aws-cli/workspaces/aws-cli-restore-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-restore-workspace.ps1 @@ -38,7 +38,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces restore-workspace ` --workspace-id $AwsWorkspaceId diff --git a/aws-cli/workspaces/aws-cli-start-workspace.ps1 b/aws-cli/workspaces/aws-cli-start-workspace.ps1 index 88fcfc7..3a4be86 100644 --- a/aws-cli/workspaces/aws-cli-start-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-start-workspace.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces start-workspaces ` --start-workspace-requests WorkspaceId=$AwsWorkspaceId diff --git a/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 b/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 index 5c18615..a953bbc 100644 --- a/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 +++ b/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces stop-workspaces ` --stop-workspace-requests WorkspaceId=$AwsWorkspaceId diff --git a/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 b/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 index 7a43272..edc2f32 100644 --- a/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces terminate-workspaces ` --terminate-workspace-requests $AwsWorkspaceId \ No newline at end of file diff --git a/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 b/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 index 7383f6f..e4cf926 100644 --- a/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 +++ b/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 @@ -30,9 +30,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" - -# Add your code here... +$ErrorActionPreference = "Stop" aws workspaces create-workspaces ` --workspaces DirectoryId=string,UserName=string,BundleId=string,VolumeEncryptionKey=string,UserVolumeEncryptionEnabled=boolean,RootVolumeEncryptionEnabled=boolean,WorkspaceProperties={RunningMode=string,RunningModeAutoStopTimeoutInMinutes=integer,RootVolumeSizeGib=integer,UserVolumeSizeGib=integer,ComputeTypeName=string,Protocols=[string,string],OperatingSystemName=string},Tags=[{Key=string,Value=string},{Key=string,Value=string}],WorkspaceName=string diff --git a/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 b/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 index 2531156..4adf8a9 100644 --- a/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 +++ b/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 @@ -35,7 +35,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" aws workspaces modify-workspace-creation-properties ` --resource-id $AwsWorkspaceId ` diff --git a/aws-cli/workspaces/wip_aws-cli-modify-workspace-properties.ps1 b/aws-cli/workspaces/wip_aws-cli-modify-workspace-properties.ps1 index 7d99069..2dd4c20 100644 --- a/aws-cli/workspaces/wip_aws-cli-modify-workspace-properties.ps1 +++ b/aws-cli/workspaces/wip_aws-cli-modify-workspace-properties.ps1 @@ -30,7 +30,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Add your code here... diff --git a/aws-cli/xoap/aws-cli-register-node.ps1 b/aws-cli/xoap/aws-cli-register-node.ps1 index a426824..e352cdb 100644 --- a/aws-cli/xoap/aws-cli-register-node.ps1 +++ b/aws-cli/xoap/aws-cli-register-node.ps1 @@ -55,7 +55,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" $runPSCommand = Send-SSMCommand ` -InstanceIds @($AwsInstanceId) ` diff --git a/aws-ps/connect/wip_set-awscredential.ps1 b/aws-ps/connect/wip_set-awscredential.ps1 index 4d5cae7..7472b24 100644 --- a/aws-ps/connect/wip_set-awscredential.ps1 +++ b/aws-ps/connect/wip_set-awscredential.ps1 @@ -30,7 +30,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Add your code here... diff --git a/aws-ps/workspaces/aws-ps-create-workspace.ps1 b/aws-ps/workspaces/aws-ps-create-workspace.ps1 index 5c50c55..08568d0 100644 --- a/aws-ps/workspaces/aws-ps-create-workspace.ps1 +++ b/aws-ps/workspaces/aws-ps-create-workspace.ps1 @@ -44,6 +44,6 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" New-WKSWorkspace -Workspace @{"BundleID" = $AwsWorkspaceBundleIdBundleId; "DirectoryId" = $AwsWorkspaceDirectoryId; "UserName" = $AwsWorkspaceUserName} diff --git a/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 b/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 index fd04c87..9af8003 100644 --- a/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 +++ b/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 @@ -35,6 +35,6 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" Restart-WKSWorkspace -WorkspaceId $AwsWorkspaceId diff --git a/azure-cli/arm/az-cli-deploy-arm.ps1 b/azure-cli/arm/az-cli-deploy-arm.ps1 index c022ade..892d0c0 100644 --- a/azure-cli/arm/az-cli-deploy-arm.ps1 +++ b/azure-cli/arm/az-cli-deploy-arm.ps1 @@ -52,7 +52,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Deploy template into resource group az deployment group create ` diff --git a/azure-cli/avd/az-cli-create-avd-application-group.ps1 b/azure-cli/avd/az-cli-create-avd-application-group.ps1 index 72f8909..b662a8e 100644 --- a/azure-cli/avd/az-cli-create-avd-application-group.ps1 +++ b/azure-cli/avd/az-cli-create-avd-application-group.ps1 @@ -50,7 +50,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az desktopvirtualization applicationgroup create ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/avd/az-cli-create-avd-workspace.ps1 b/azure-cli/avd/az-cli-create-avd-workspace.ps1 index 17322c4..27be0e4 100644 --- a/azure-cli/avd/az-cli-create-avd-workspace.ps1 +++ b/azure-cli/avd/az-cli-create-avd-workspace.ps1 @@ -46,7 +46,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az desktopvirtualization workspace create ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/avd/az-cli-update-avd-hostpool.ps1 b/azure-cli/avd/az-cli-update-avd-hostpool.ps1 index ac0da2a..1f289e2 100644 --- a/azure-cli/avd/az-cli-update-avd-hostpool.ps1 +++ b/azure-cli/avd/az-cli-update-avd-hostpool.ps1 @@ -46,7 +46,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az desktopvirtualization hostpool update ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/avd/wip_az-cli-create-avd-hostpool.ps1 b/azure-cli/avd/wip_az-cli-create-avd-hostpool.ps1 index 32fd756..36a1218 100644 --- a/azure-cli/avd/wip_az-cli-create-avd-hostpool.ps1 +++ b/azure-cli/avd/wip_az-cli-create-avd-hostpool.ps1 @@ -1,9 +1,15 @@ <# .SYNOPSIS - Short description + This script creates an Azure Virtual Desktop Host Pool. .DESCRIPTION - Long description + This script creates an Azure Virtual Desktop Host Pool. + The script uses the following Azure CLI command: + az desktopvirtualization hostpool create --host-pool-type $AzHostPoolType --load-balancer-type $AzLoadBalancerType --name $AzHostPoolName --preferred-app-group-type $AzPreferredAppGroupType --resource-group $AzResourceGroupName --custom-rdp-property $AzCustomRdpProperty --description $AzDescription --friendly-name $AzFriendlyName --location $AzLocation --max-session-limit $AzMaxSessionLimit --personal-desktop-assignment-type $AzPersonalDesktopAssignmentType --registration-info $AzRegistrationInfo --sso-client-id $AzSsoClientId --sso-client-secret-key-vault-path $AzSsoClientSecretKeyVaultPath --sso-secret-type $AzSsoSecretType --ssoadfs-authority $AzSsoAdfsAuthority --start-vm-on-connect $AzStartVmOnConnect --tags $AzTags --validation-environment $AzValidationEnvironment --vm-template $AzVmTemplate + + The script sets the ErrorActionPreference to SilentlyContinue to suppress error messages. + + It does not return any output. .NOTES This PowerShell script was developed and optimized for the usage with the XOAP Scripted Actions module. @@ -14,7 +20,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + Azure CLI .LINK https://github.com/xoap-io/scripted-actions @@ -22,51 +28,120 @@ .PARAMETER AzResourceGroupName Defines the name of the Azure Resource Group. +.PARAMETER AzHostPoolName + Defines the name of the Azure Virtual Desktop Host Pool. + +.PARAMETER AzResourceGroupName + Defines the name of the Azure Resource Group. + +.PARAMETER AzHostPoolFriendlyName + +.PARAMETER AzHostPoolType + Defines the type of the Azure Host Pool. + +.PARAMETER AzPreferredAppGroupType + Defines the preferred app group type. + +.PARAMETER AzRegistrationInfo + Defines the registration info. + +.PARAMETER AzSsoClientId + Defines the SSO client ID. + +.PARAMETER AzSsoClientSecretKeyVaultPath + Defines the SSO client secret key vault path. + +.PARAMETER AzSsoSecretType + Defines the SSO secret type. + +.PARAMETER AzStartVmOnConnect + Defines if the VM should start on connect. + +.PARAMETER AzValidationEnvironment + Defines the validation environment. + +.PARAMETER AzVmTemplate + Defines the VM template. + #> [CmdletBinding()] param( [Parameter(Mandatory)] [ValidateSet('BreadthFirst', 'DepthFirst', 'Persistent')] - [string]$AzLoadBalancerType + [string]$AzLoadBalancerType, + [Parameter(Mandatory)] + [string]$AzHostPoolName = 'myHostPoolName', + [Parameter(Mandatory)] + [string]$AzResourceGroupName = 'myResourceGroupName', + [Parameter(Mandatory)] + [string]$AzHostPoolFriendlyName = 'myFriendlyName', + [Parameter(Mandatory)] + [ValidateSet('BYODesktop', 'Personal', 'Pooled')] + [string]$AzHostPoolType, + [Parameter(Mandatory)] + [ValidateSet('Desktop', 'None', 'RailApplications')] + [string]$AzPreferredAppGroupType, + [Parameter(Mandatory)] + [string]$AzSsoClientId = 'myClientId', + [Parameter(Mandatory)] + [string]$AzSsoClientSecretKeyVaultPath = 'myKeyVaultPath', + [Parameter(Mandatory)] + [ValidateSet('Certificate', 'CertificateInKeyVault', 'SharedKey', 'SharedKeyInKeyVault')] + [string]$AzSsoSecretType, + [Parameter(Mandatory)] + [ValidateSet('0', '1', 'f', 'false', 'n', 'no', 't', 'true', 'y', 'yes')] + [string]$AzStartVmOnConnect, + [Parameter(Mandatory)] + [ValidateSet('0', '1', 'f', 'false', 'n', 'no', 't', 'true', 'y', 'yes')] + [string]$AzValidationEnvironment, + [Parameter(Mandatory)] + [string]$AzVmTemplate = 'Windows-10-Enterprise-N-x64', + [Parameter(Mandatory)] + [string]$AzLocation = 'westeurope', + [Parameter(Mandatory)] + [string]$AzMaxSessionLimit = 999999, + [Parameter(Mandatory)] + [ValidateSet('Automatic', 'Direct')] + [string]$AzPersonalDesktopAssignmentType = 'Automatic', + [Parameter(Mandatory)] + [string]$AzSsoAdfsAuthority = 'https://adfs.contoso.com/adfs', + [Parameter(Mandatory = $false)] + [string]$AzCustomRdpProperty = 'audiocapturemode:i:1;audiomode:i:0;authentication level:i:2;autoreconnection enabled:i:1;bitmapcachepersistenable:i:1;bitmapcachesize:i:1;compression:i:1;connection type:i:7;desktopheight:i:900;desktopwidth:i:1440;disable full window drag:i:1;disable menu anims:i:1;disable themes:i:0;disable wallpaper:i:0;displayconnectionbar:i:1;domain:s:contoso.com;enablecredsspsupport:i:1;full address:s:rdp.contoso.com;gatewayaccesstoken:s:;gatewaycredentialssource:i:0;gatewayhostname:s:;gatewayprofileusagemethod:i:0;gatewayusagemethod:i:0;keyboardhook:i:2;loadbalanceinfo:s:tsv://MS Terminal Services Plugin.1.Contoso;negotiate security layer:i:1;prompt for credentials:i:0;promptcredentialonce:i:0;redirectclipboard:i:1;remoteapplicationcmdline:s:;remoteapplicationexpandcmdline:s:1;remoteapplicationexpandworkingdir:s:1;remoteapplicationfile:s:;remoteapplicationguid:s:;remoteapplicationname:s:RemoteApp;remoteapplicationprogram:s:||RemoteApp;remoteapplicationprogrammode:i:1;remoteapplicationprogramse', + [Parameter(Mandatory)] + [string]$AzDescription = 'myDescription', + [Parameter(Mandatory)] + [string]$AzFriendlyName = 'myFriendlyName', + [Parameter(Mandatory)] + [string]$AzRegistrationInfo = 'expiration-time="yyyy-mm-ddT08:38:08.189Z" registration-token-operation=Update', + [Parameter(Mandatory)] + [string]$AzSsoClientId = 'client', + [Parameter(Mandatory)] + [ValidateSet('0', '1', 'f', 'false', 'n', 'no', 't', 'true', 'y', 'yes')] + [string]$AzStartVmOnConnect = 'false', + [Parameter(Mandatory)] + [string]$AzTags = 'myTags' ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" - -az desktopvirtualization hostpool create --host-pool-type {BYODesktop, Personal, Pooled} - --load-balancer-type {BreadthFirst, DepthFirst, Persistent} - --name - --preferred-app-group-type {Desktop, None, RailApplications} - --resource-group - [--custom-rdp-property] - [--description] - [--friendly-name] - [--location] - [--max-session-limit] - [--personal-desktop-assignment-type {Automatic, Direct}] - [--registration-info] - [--ring] - [--sso-client-id] - [--sso-client-secret-key-vault-path] - [--sso-secret-type {Certificate, CertificateInKeyVault, SharedKey, SharedKeyInKeyVault}] - [--ssoadfs-authority] - [--start-vm-on-connect {0, 1, f, false, n, no, t, true, y, yes}] - [--tags] - [--validation-environment {0, 1, f, false, n, no, t, true, y, yes}] - [--vm-template] - - -az desktopvirtualization hostpool create ` - --resource-group $AzResourceGroupName ` +$ErrorActionPreference = "Stop" + +az desktopvirtualization hostpool create --host-pool-type $AzHostPoolType ` + --load-balancer-type $AzLoadBalancerType ` --name $AzHostPoolName ` - --friendly-name $AzHostPoolFriendlyName ` - --host-pool-type Pooled ` - --load-balancer-type BreadthFirst ` - --max-session-limit 999999 ` - --personal-desktop-assignment-type Automatic ` - --preferred-app-group-type Desktop ` - --registration-info expiration-time="yyyy-mm-ddT08:38:08.189Z" registration-token-operation=Update ` - --sso-client-id client ` - --sso-client-secret-key-vault-path https://keyvault/secret ` - --sso-secret-type SharedKey ` - --start-vm-on-connect false + --preferred-app-group-type $AzPreferredAppGroupType ` + --resource-group $AzResourceGroupName ` + --custom-rdp-property $AzCustomRdpProperty ` + --description $AzDescription ` + --friendly-name $AzFriendlyName ` + --location $AzLocation ` + --max-session-limit $AzMaxSessionLimit ` + --personal-desktop-assignment-type $AzPersonalDesktopAssignmentType ` + --registration-info $AzRegistrationInfo ` + --sso-client-id $AzSsoClientId ` + --sso-client-secret-key-vault-path $AzSsoClientSecretKeyVaultPath ` + --sso-secret-type $AzSsoSecretType ` + --ssoadfs-authority $AzSsoAdfsAuthority ` + --start-vm-on-connect $AzStartVmOnConnect ` + --tags $AzTags ` + --validation-environment $AzValidationEnvironment ` + --vm-template $AzVmTemplate diff --git a/azure-cli/bicep/wip_az-cli-avd-accelerator-baseline.ps1 b/azure-cli/bicep/wip_az-cli-avd-accelerator-baseline.ps1 new file mode 100644 index 0000000..0035572 --- /dev/null +++ b/azure-cli/bicep/wip_az-cli-avd-accelerator-baseline.ps1 @@ -0,0 +1,138 @@ +<# +.SYNOPSIS + This script creates an Azure Virtual Desktop Accelerator baseline deployment with Azure Bicep. + +.DESCRIPTION + This script creates an Azure Virtual Desktop Accelerator baseline deployment with Azure Bicep. + The script uses the following Azure CLI command: + az deployment create --template-file $AzBicepFile --parameters $AzBicepParametersFile --parameters avdWorkloadSubsId=$AzSubscriptionId --parameters deploymentPrefix=$AzDeploymentPrefix --parameters avdVmLocalUserName=$AzVmLocalUserName --parameters avdVmLocalUserPassword=$AzLocalUserPassword --parameters avdIdentityServiceProvider=$AzIdentityServiceProvider --parameters avdIdentityDomainName=$AzIdentityDomainName --parameters avdDomainJoinUserName=$AzDomainJoinUserName --parameters avdDomainJoinUserPassword=$AzDomainJoinUserPassword --parameters existingHubVnetResourceId=$AzHubVnetResourceId --parameters customDnsIps=$AzCustomDnsIps --parameters avdEnterpriseAppObjectId=$AzEnterpriseAppObjectId --parameters avdVnetPrivateDnsZone=true --parameters avdVnetPrivateDnsZoneFilesId=$AzPrivateDnsZoneFilesId --parameters avdVnetPrivateDnsZoneKeyvaultId=$AzPrivateDnsZoneKeyvaultId --avdDeployMonitoring=true --deployAlaWorkspace=true --location $AzLocation + + The script sets the ErrorActionPreference to SilentlyContinue to suppress error messages. + + It does not return any output. + +.NOTES + This PowerShell script was developed and optimized for the usage with the XOAP Scripted Actions module. + The use of the scripts does not require XOAP, but it will make your life easier. + You are allowed to pull the script from the repository and use it with XOAP or other solutions + The terms of use for the XOAP platform do not apply to this script. In particular, RIS AG assumes no liability for the function, + the use and the consequences of the use of this freely available script. + PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG + +.COMPONENT + Azure CLI + +.LINK + https://github.com/xoap-io/scripted-actions + +.LINK + https://github.com/Azure/avdaccelerator/tree/main/workload/bicep + +.PARAMETER AzBicepFile + Defines the path to the Azure Bicep file. + +.PARAMETER AzBicepParametersFile + Defines the path to the Azure Bicep parameters file. + +.PARAMETER AzSubscriptionId + AVD workload subscription ID, multiple subscriptions scenario. (Default: "") + +.PARAMETER AzDeploymentPrefix + The name of the resource group to deploy. (Default: AVD1) + +.PARAMETER AzVmLocalUserName + AVD session host local username. + +.PARAMETER AzLocalUserPassword + AVD session host local password. + +.PARAMETER AzIdentityServiceProvider + The service providing domain services for Azure Virtual Desktop. (Default: ADDS) + +.PARAMETER AzIdentityDomainName + FQDN of on-premises AD domain, used for FSLogix storage configuration and NTFS setup. (Default: "") + +.PARAMETER AzDomainJoinUserName + AVD session host domain join user principal name. (Default: none) + +.PARAMETER AzDomainJoinUserPassword + AVD session host domain join password. (Default: none) + +.PARAMETER AzHubVnetResourceId + Existing hub virtual network for perring. (Default: "") + +.PARAMETER AzCustomDnsIps + Custom DNS IPs for the AVD session host. (Default: "") + +.PARAMETER AzEnterpriseAppObjectId + The object ID of the enterprise application. (Default: "") + +.PARAMETER AzPrivateDnsZoneFilesId + Create new Azure private DNS zones for private endpoints. (Default: true) + +.PARAMETER AzPrivateDnsZoneKeyvaultId + Use existing Azure private DNS zone for key vault privatelink.vaultcore.azure.net or privatelink.vaultcore.usgovcloudapi.net. (Default: "") + +.PARAMETER AzLocation + Defines the location of the Azure Resource Group. + +#> +[CmdletBinding()] +param( + [Parameter(Mandatory)] + [string]$AzBicepFile, + [Parameter(Mandatory)] + [string]$AzBicepParametersFile, + [Parameter(Mandatory)] + [string]$AzSubscriptionId, + [Parameter(Mandatory)] + [string]$AzDeploymentPrefix, + [Parameter(Mandatory)] + [string]$AzVmLocalUserName, + [Parameter(Mandatory)] + [securestring]$AzLocalUserPassword, + [Parameter(Mandatory)] + [string]$AzIdentityServiceProvider, + [Parameter(Mandatory)] + [string]$AzIdentityDomainName, + [Parameter(Mandatory)] + [string]$AzDomainJoinUserName, + [Parameter(Mandatory)] + [securestring]$AzDomainJoinUserPassword, + [Parameter(Mandatory)] + [string]$AzHubVnetResourceId, + [Parameter(Mandatory)] + [string]$AzCustomDnsIps, + [Parameter(Mandatory)] + [string]$AzEnterpriseAppObjectId, + [Parameter(Mandatory)] + [string]$AzPrivateDnsZoneFilesId, + [Parameter(Mandatory)] + [string]$AzPrivateDnsZoneKeyvaultId, + [Parameter(Mandatory)] + [string]$AzLocation + ) + +#Set Error Action to Silently Continue +$ErrorActionPreference = "Stop" + +az deployment create ` + --template-file $AzBicepFile ` + --parameters $AzBicepParametersFile ` + --parameters avdWorkloadSubsId=$AzSubscriptionId ` + --parameters deploymentPrefix=$AzDeploymentPrefix ` + --parameters avdVmLocalUserName=$AzVmLocalUserName ` + --parameters avdVmLocalUserPassword=$AzLocalUserPassword ` + --parameters avdIdentityServiceProvider=$AzIdentityServiceProvider ` + --parameters avdIdentityDomainName=$AzIdentityDomainName ` + --parameters avdDomainJoinUserName=$AzDomainJoinUserName ` ` + --parameters avdDomainJoinUserPassword=$AzDomainJoinUserPassword ` + --parameters existingHubVnetResourceId=$AzHubVnetResourceId ` + --parameters customDnsIps=$AzCustomDnsIps ` + --parameters avdEnterpriseAppObjectId=$AzEnterpriseAppObjectId ` + --parameters avdVnetPrivateDnsZone=true ` + --parameters avdVnetPrivateDnsZoneFilesId=$AzPrivateDnsZoneFilesId ` + --parameters avdVnetPrivateDnsZoneKeyvaultId=$AzPrivateDnsZoneKeyvaultId ` + --avdDeployMonitoring=true ` + --deployAlaWorkspace=true ` + --location $AzLocation diff --git a/azure-cli/bicep/az-cli-deploy-bicep.ps1 b/azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 similarity index 97% rename from azure-cli/bicep/az-cli-deploy-bicep.ps1 rename to azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 index 9fc5859..024635e 100644 --- a/azure-cli/bicep/az-cli-deploy-bicep.ps1 +++ b/azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 @@ -52,7 +52,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az deployment group create ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/network/az-cli-create-virtual-network.ps1 b/azure-cli/network/az-cli-create-virtual-network.ps1 index 3a87e87..8064f8d 100644 --- a/azure-cli/network/az-cli-create-virtual-network.ps1 +++ b/azure-cli/network/az-cli-create-virtual-network.ps1 @@ -56,7 +56,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Create a virtual network and subnet az network vnet create ` diff --git a/azure-cli/resource-manager/az-cli-create-resource-group.ps1 b/azure-cli/resource-manager/az-cli-create-resource-group.ps1 index 4b93671..fbf0542 100644 --- a/azure-cli/resource-manager/az-cli-create-resource-group.ps1 +++ b/azure-cli/resource-manager/az-cli-create-resource-group.ps1 @@ -37,11 +37,12 @@ param( [Parameter(Mandatory)] [string]$AzResourceGroupName, [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral', 'westcentralus', 'southcentralus', 'southcentralus', 'centralus', 'northcentralus', 'eastus2euap', 'westus3', 'southeastasia', 'eastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'canadacentral', 'canadaeast', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'norwayeast', 'norwaywest', 'switzerlandnorth', 'switzerlandwest', 'germanynorth', 'germanywestcentral', 'uaenorth', 'uaecentral', 'southafricanorth', 'southafricawest', 'brazilsouth', 'brazilus', 'koreacentral', 'koreasouth', 'koreasouth', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'canadacentral', 'canadaeast', 'centralindia', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'francecentral', 'francesouth', 'germanywestcentral', 'japaneast', 'japanwest', 'northcentralus', 'northeurope', 'southafricanorth', 'southcentralus', 'southeastasia', 'switzerlandnorth', 'switzerlandwest', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2')] [string]$AzLocation ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Create a new Azure Resource Group az group create ` diff --git a/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 b/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 index 349362a..40d0c71 100644 --- a/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 +++ b/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az group delete ` - --resource-group $AzResourceGroupName + --resource-group $AzResourceGroupName --yes --no-wait diff --git a/azure-cli/security/wip_az-cli-create-nsg.ps1 b/azure-cli/security/wip_az-cli-create-nsg.ps1 index 363643e..994c540 100644 --- a/azure-cli/security/wip_az-cli-create-nsg.ps1 +++ b/azure-cli/security/wip_az-cli-create-nsg.ps1 @@ -31,7 +31,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az network nsg rule create ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/storage/az-cli-create-storage-account.ps1 b/azure-cli/storage/az-cli-create-storage-account.ps1 index 8696767..9e8972c 100644 --- a/azure-cli/storage/az-cli-create-storage-account.ps1 +++ b/azure-cli/storage/az-cli-create-storage-account.ps1 @@ -43,6 +43,7 @@ param( [Parameter(Mandatory)] [string]$AzResourceGroupName, [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral', 'westcentralus', 'southcentralus', 'southcentralus', 'centralus', 'northcentralus', 'eastus2euap', 'westus3', 'southeastasia', 'eastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'canadacentral', 'canadaeast', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'norwayeast', 'norwaywest', 'switzerlandnorth', 'switzerlandwest', 'germanynorth', 'germanywestcentral', 'uaenorth', 'uaecentral', 'southafricanorth', 'southafricawest', 'brazilsouth', 'brazilus', 'koreacentral', 'koreasouth', 'koreasouth', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'canadacentral', 'canadaeast', 'centralindia', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'francecentral', 'francesouth', 'germanywestcentral', 'japaneast', 'japanwest', 'northcentralus', 'northeurope', 'southafricanorth', 'southcentralus', 'southeastasia', 'switzerlandnorth', 'switzerlandwest', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2')] [string]$AzLocation, [Parameter(Mandatory)] [string]$AzStorageAccountName, @@ -52,7 +53,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az storage account create ` --name $AzStorageAccountName ` diff --git a/azure-cli/vms/az-cli-create-image-definition.ps1 b/azure-cli/vms/az-cli-create-image-definition.ps1 index 6fca428..92208a8 100644 --- a/azure-cli/vms/az-cli-create-image-definition.ps1 +++ b/azure-cli/vms/az-cli-create-image-definition.ps1 @@ -28,26 +28,26 @@ .PARAMETER AzResourceGroupName Defines the name of the Azure Resource Group. -.PARAMETER AzLocation - Defines the location of the Azure Resource Group. +.PARAMETER AzGalleryName + Defines the name of the Azure Gallery. -.PARAMETER AzVmName - Defines the name of the Azure VM. +.PARAMETER AzImageDefinition + Defines the name of the Azure Image Definition. -.PARAMETER AzImageName - Defines the name of the Azure Image. +.PARAMETER AzImagePublisher + Defines the name of the Azure Image Publisher. -.PARAMETER AzPublicIpAddressName - Defines the name of the Azure Public IP Address. +.PARAMETER AzImageOffer + Defines the name of the Azure Image Offer. -.PARAMETER AzVmCredential - Defines the credentials of the Azure VM. +.PARAMETER AzImageSku + Defines the name of the Azure Image SKU. -.PARAMETER AzOpenPorts - Defines the open ports of the Azure VM. +.PARAMETER AzImageType + Defines the type of the Azure Image. -.PARAMETER AzVmSize - Defines the size of the Azure VM. +.PARAMETER AzOsState + Defines the state of the Azure OS. #> [CmdletBinding()] @@ -59,19 +59,21 @@ param( [Parameter(Mandatory)] [string]$AzImageDefinition, [Parameter(Mandatory)] - [string]$AzImagePublisher, + [string]$AzImagePublisher = "MicrosoftWindowsDesktop", [Parameter(Mandatory)] [string]$AzImageOffer, [Parameter(Mandatory)] - [string]$AzImageSku, + [string]$AzImageSku = 'win11-23h2-entn', [Parameter(Mandatory)] + [ValidateSet("Windows", "Linux")] [string]$AzImageType, [Parameter(Mandatory)] + [ValidateSet("Generalized", "Specialized")] [string]$AzOsState ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az sig image-definition create ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/vms/az-cli-create-image-gallery.ps1 b/azure-cli/vms/az-cli-create-image-gallery.ps1 index a6b2f7f..cb9ca97 100644 --- a/azure-cli/vms/az-cli-create-image-gallery.ps1 +++ b/azure-cli/vms/az-cli-create-image-gallery.ps1 @@ -39,15 +39,16 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral', 'westcentralus', 'southcentralus', 'southcentralus', 'centralus', 'northcentralus', 'eastus2euap', 'westus3', 'southeastasia', 'eastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'canadacentral', 'canadaeast', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'norwayeast', 'norwaywest', 'switzerlandnorth', 'switzerlandwest', 'germanynorth', 'germanywestcentral', 'uaenorth', 'uaecentral', 'southafricanorth', 'southafricawest', 'brazilsouth', 'brazilus', 'koreacentral', 'koreasouth', 'koreasouth', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'canadacentral', 'canadaeast', 'centralindia', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'francecentral', 'francesouth', 'germanywestcentral', 'japaneast', 'japanwest', 'northcentralus', 'northeurope', 'southafricanorth', 'southcentralus', 'southeastasia', 'switzerlandnorth', 'switzerlandwest', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2')] [string]$AzLocation, [Parameter(Mandatory)] - [string]$AzGalleryName + [string]$AzGalleryName = "myImageGallery" ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az group create ` --name $AzResourceGroupName ` diff --git a/azure-cli/vms/az-cli-create-image-version.ps1 b/azure-cli/vms/az-cli-create-image-version.ps1 index cfa3754..1ab4b6d 100644 --- a/azure-cli/vms/az-cli-create-image-version.ps1 +++ b/azure-cli/vms/az-cli-create-image-version.ps1 @@ -52,25 +52,25 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "MyResourceGroup", [Parameter(Mandatory)] - [string]$AzGallery, + [string]$AzGallery = "MyGallery", [Parameter(Mandatory)] - [string]$AzImageDefinition, + [string]$AzImageDefinition = "MyImageDefinition", [Parameter(Mandatory)] - [string]$AzGalleryImageVersion, + [string]$AzGalleryImageVersion = "1.0.0", [Parameter(Mandatory)] - [string]$AzTargetRegions, + [string]$AzTargetRegions = "westus", [Parameter(Mandatory)] - [string]$AzReplicaCount, + [string]$AzReplicaCount = 1, [Parameter(Mandatory)] - [string]$AzSubscriptionId, + [string]$AzSubscriptionId = "00000000-0000-0000-0000-000000000000", [Parameter(Mandatory)] - [string]$AzVmName + [string]$AzVmName = "MyVm" ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az sig image-version create ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/vms/az-cli-create-vm-scale-set.ps1 b/azure-cli/vms/az-cli-create-vm-scale-set.ps1 index 0b2a36a..62b6c15 100644 --- a/azure-cli/vms/az-cli-create-vm-scale-set.ps1 +++ b/azure-cli/vms/az-cli-create-vm-scale-set.ps1 @@ -55,22 +55,22 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] - [string]$AzScaleSetName, + [string]$AzScaleSetName = 'myScaleSet', [Parameter(Mandatory)] [ValidateSet("Flexible", "Uniform")] [string]$AzOrchestrationMode = 'Flexible', [Parameter(Mandatory)] - [string]$AzSkuImage, + [string]$AzSkuImage = 'UbuntuLTS', [Parameter(Mandatory)] [string]$AzScaleSetInstanceCount = 2, [Parameter(Mandatory)] - [string]$AzAdminUserName + [string]$AzAdminUserName = 'azureuser' ) # Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az vmss create ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/vms/az-cli-create-windows-vm.ps1 b/azure-cli/vms/az-cli-create-windows-vm.ps1 index 92972fc..44e81e0 100644 --- a/azure-cli/vms/az-cli-create-windows-vm.ps1 +++ b/azure-cli/vms/az-cli-create-windows-vm.ps1 @@ -51,22 +51,24 @@ param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "MyResourceGroup", [Parameter(Mandatory)] - [string]$AzVmName, + [string]$AzVmName = "MyVm", [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral', 'westcentralus', 'southcentralus', 'southcentralus', 'centralus', 'northcentralus', 'eastus2euap', 'westus3', 'southeastasia', 'eastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'canadacentral', 'canadaeast', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'norwayeast', 'norwaywest', 'switzerlandnorth', 'switzerlandwest', 'germanynorth', 'germanywestcentral', 'uaenorth', 'uaecentral', 'southafricanorth', 'southafricawest', 'brazilsouth', 'brazilus', 'koreacentral', 'koreasouth', 'koreasouth', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'canadacentral', 'canadaeast', 'centralindia', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'francecentral', 'francesouth', 'germanywestcentral', 'japaneast', 'japanwest', 'northcentralus', 'northeurope', 'southafricanorth', 'southcentralus', 'southeastasia', 'switzerlandnorth', 'switzerlandwest', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2')] [string]$AzLocation, [Parameter(Mandatory)] - [string]$AzImageName, + [string]$AzImageName = "Win2019Datacenter", [Parameter(Mandatory)] - [string]$AzPublicIpAddressName, + [string]$AzPublicIpAddressName = "MyPublicIpAddress", [Parameter(Mandatory)] - [string]$AzVmUserName, + [string]$AzVmUserName = "MyVmUser", [Parameter(Mandatory)] - [Securestring]$AzVmUserPassword, + [Securestring]$AzVmUserPassword = "MyVmUserPassword", [Parameter(Mandatory)] [string]$AzOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) diff --git a/azure-cli/vms/az-cli-delete-image-builder-windows.ps1 b/azure-cli/vms/az-cli-delete-image-builder-windows.ps1 index b28fc94..732bd71 100644 --- a/azure-cli/vms/az-cli-delete-image-builder-windows.ps1 +++ b/azure-cli/vms/az-cli-delete-image-builder-windows.ps1 @@ -65,21 +65,21 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "MyResourceGroup", [Parameter(Mandatory)] - [string]$AzImageBuildName, + [string]$AzImageBuildName = "MyImageBuild", [Parameter(Mandatory)] - [string]$AzAssignee, + [string]$AzAssignee = "MyAssignee", [Parameter(Mandatory)] - [string]$AzRoleDefinitionName, + [string]$AzRoleDefinitionName = "MyRoleDefinition", [Parameter(Mandatory)] - [string]$AzSubscriptionID, + [string]$AzSubscriptionID = "00000000-0000-0000-0000-000000000000", [Parameter(Mandatory)] - [string]$AzResourceId + [string]$AzResourceId = "00000000-0000-0000-0000-000000000000" ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az resource delete ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/vms/az-cli-enable-EntraID-login-linux-vm.ps1 b/azure-cli/vms/az-cli-enable-EntraID-login-linux-vm.ps1 index 2039276..281fe64 100644 --- a/azure-cli/vms/az-cli-enable-EntraID-login-linux-vm.ps1 +++ b/azure-cli/vms/az-cli-enable-EntraID-login-linux-vm.ps1 @@ -42,18 +42,18 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzExtensionName, + [string]$AzExtensionName = "Microsoft.Azure.ActiveDirectory", [Parameter(Mandatory)] - [string]$AzVmName + [string]$AzVmName = "myVmName" ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az vm extension set ` - --publisher Microsoft.Azure.ActiveDirectory ` + --publisher $AzExtensionName ` --name $AzExtensionName ` --resource-group $AzResourceGroupName ` --vm-name $AzVmName diff --git a/azure-cli/vms/az-cli-install-webserver-vm.ps1 b/azure-cli/vms/az-cli-install-webserver-vm.ps1 index 6228efe..6f63870 100644 --- a/azure-cli/vms/az-cli-install-webserver-vm.ps1 +++ b/azure-cli/vms/az-cli-install-webserver-vm.ps1 @@ -51,9 +51,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzVmName, + [string]$AzVmName = "myVmName", [Parameter(Mandatory)] [string]$Script = "Install-WindowsFeature -name Web-Server -IncludeManagementTools", [Parameter(Mandatory)] @@ -61,7 +61,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az vm run-command invoke ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/vms/az-cli-share-image-gallery.ps1 b/azure-cli/vms/az-cli-share-image-gallery.ps1 index 8dd58a2..bb58cc5 100644 --- a/azure-cli/vms/az-cli-share-image-gallery.ps1 +++ b/azure-cli/vms/az-cli-share-image-gallery.ps1 @@ -47,15 +47,15 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzGalleryName, + [string]$AzGalleryName = "myGallery", [Parameter(Mandatory)] - [string]$EmailAddress + [string]$EmailAddress = "hello@xoap.io" ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" $GalleryId = az sig show ` --resource-group $AzResourceGroupName ` diff --git a/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 b/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 index 107139a..243b9bb 100644 --- a/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 +++ b/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 @@ -26,15 +26,16 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] [string]$AZOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az provider register -n Microsoft.VirtualMachineImages az provider register -n Microsoft.Compute diff --git a/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 b/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 index f78b184..134a40a 100644 --- a/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 +++ b/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 @@ -26,15 +26,16 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] [string]$AZOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Register the providers diff --git a/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 b/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 index 54d66a3..c0f850e 100644 --- a/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 +++ b/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 @@ -26,15 +26,16 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] [string]$AZOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az vm create ` --resource-group $MY_RESOURCE_GROUP_NAME ` diff --git a/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 b/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 index ee5426d..c9bf0e0 100644 --- a/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 +++ b/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 @@ -26,15 +26,16 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] [string]$AZOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az group create --name myResourceGroup --location eastus az vm create --resource-group myResourceGroup ` diff --git a/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 b/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 index 28a49fe..0232113 100644 --- a/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 +++ b/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 @@ -26,15 +26,16 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] [string]$AZOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" az resource delete ` --resource-group $sigResourceGroup ` diff --git a/azure-cli/xoap/az-cli-register-node.ps1 b/azure-cli/xoap/az-cli-register-node.ps1 index 150534b..b5c2fa9 100644 --- a/azure-cli/xoap/az-cli-register-node.ps1 +++ b/azure-cli/xoap/az-cli-register-node.ps1 @@ -47,13 +47,13 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzVmName, + [string]$AzVmName = "myVmName", [Parameter(Mandatory)] - [string]$XOAPWorkspaceId, + [string]$XOAPWorkspaceId = "myWorkspaceId", [Parameter(Mandatory)] - [string]$XOAPGroupName + [string]$XOAPGroupName = "XOAP unassigned" ) # Register VM in XOAP diff --git a/azure-ps/avd/az-ps-create-avd-workspace.ps1 b/azure-ps/avd/az-ps-create-avd-workspace.ps1 index 353c4f3..e1fc45e 100644 --- a/azure-ps/avd/az-ps-create-avd-workspace.ps1 +++ b/azure-ps/avd/az-ps-create-avd-workspace.ps1 @@ -51,21 +51,22 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] - [string]$AzWorkspaceName, + [string]$AzWorkspaceName = 'myWorkspace', [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] [string]$AzLocation, [Parameter(Mandatory)] - [string]$AzFriendlyName, + [string]$AzFriendlyName = 'myFriendlyName', [Parameter(Mandatory)] - [string]$AzApplicationGroupName, + [string]$AzApplicationGroupName = 'myApplicationGroup', [Parameter(Mandatory)] - [string]$AzDescription + [string]$AzDescription = 'MyDescription' ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" New-AzWvdWorkspace -ResourceGroupName $AzResourceGroupName ` -Name $AzWorkspaceName ` diff --git a/azure-ps/avd/az-ps-disconnect-avd-user-session.ps1 b/azure-ps/avd/az-ps-disconnect-avd-user-session.ps1 index 27bce54..89ed1e0 100644 --- a/azure-ps/avd/az-ps-disconnect-avd-user-session.ps1 +++ b/azure-ps/avd/az-ps-disconnect-avd-user-session.ps1 @@ -44,17 +44,17 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] - [string]$AzHostPoolName, + [string]$AzHostPoolName = 'myHostPool', [Parameter(Mandatory)] - [string]$AzSessionHostName, + [string]$AzSessionHostName = 'mySessionHostName', [Parameter(Mandatory)] - [string]$AzSessionId + [string]$AzSessionId = 'mySessionId' ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" Disconnect-AzWvdUserSession ` -ResourceGroupName $AzResourceGroupName ` diff --git a/azure-ps/az-ps-create-linux-vm.ps1 b/azure-ps/az-ps-create-linux-vm.ps1 index 71ec284..c2b3b44 100644 --- a/azure-ps/az-ps-create-linux-vm.ps1 +++ b/azure-ps/az-ps-create-linux-vm.ps1 @@ -57,6 +57,7 @@ param( [Parameter(Mandatory)] [string]$AzVmName, [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] [string]$AzLocation, [Parameter(Mandatory)] [string]$AzImageName, @@ -72,7 +73,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" New-AzVm ` -ResourceGroupName $AzResourceGroupName ` diff --git a/azure-ps/az-ps-create-resource-group.ps1 b/azure-ps/az-ps-create-resource-group.ps1 index b3bca2f..f034ac1 100644 --- a/azure-ps/az-ps-create-resource-group.ps1 +++ b/azure-ps/az-ps-create-resource-group.ps1 @@ -37,11 +37,12 @@ param( [Parameter(Mandatory)] [string]$AzResourceGroupName, [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] [string]$AzLocation ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" New-AzResourceGroup ` -Name $AzResourceGroupName ` diff --git a/azure-ps/az-ps-create-vm-scale-set.ps1 b/azure-ps/az-ps-create-vm-scale-set.ps1 index 37167b5..53b2d07 100644 --- a/azure-ps/az-ps-create-vm-scale-set.ps1 +++ b/azure-ps/az-ps-create-vm-scale-set.ps1 @@ -59,6 +59,7 @@ param( [Parameter(Mandatory)] [string]$AzOrchestrationMode, [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] [string]$AzLocation, [Parameter(Mandatory)] [int]$AzInstanceCount, @@ -68,7 +69,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" New-AzVmss ` -ResourceGroup $AzResourceGroupName ` diff --git a/azure-ps/az-ps-delete-resource-group.ps1 b/azure-ps/az-ps-delete-resource-group.ps1 index 8fdab6e..7dbfa7f 100644 --- a/azure-ps/az-ps-delete-resource-group.ps1 +++ b/azure-ps/az-ps-delete-resource-group.ps1 @@ -33,7 +33,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" Remove-AzResourceGroup ` - -Name $AzResourceGroupName + -Name $AzResourceGroupName -Force diff --git a/azure-ps/az-ps-image-builder-windows-cleanup.ps1 b/azure-ps/az-ps-image-builder-windows-cleanup.ps1 index a17a1fa..82bc0db 100644 --- a/azure-ps/az-ps-image-builder-windows-cleanup.ps1 +++ b/azure-ps/az-ps-image-builder-windows-cleanup.ps1 @@ -39,7 +39,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" Remove-AzImageBuilderTemplate ` -ResourceGroupName $AzResourceGroupName ` diff --git a/azure-ps/az-ps-install-nginx-linux-vm.ps1 b/azure-ps/az-ps-install-nginx-linux-vm.ps1 index f2b6ce5..2ac4b27 100644 --- a/azure-ps/az-ps-install-nginx-linux-vm.ps1 +++ b/azure-ps/az-ps-install-nginx-linux-vm.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" Invoke-AzVMRunCommand ` -ResourceGroupName $AzResourceGroupName ` diff --git a/azure-ps/az-ps-install-webserver-windows.ps1 b/azure-ps/az-ps-install-webserver-windows.ps1 index 9f1e9bc..ca0ddbc 100644 --- a/azure-ps/az-ps-install-webserver-windows.ps1 +++ b/azure-ps/az-ps-install-webserver-windows.ps1 @@ -40,7 +40,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" Invoke-AzVMRunCommand ` -ResourceGroupName $AzResourceGroupName ` diff --git a/azure-ps/bicep/az-ps-deploy-bicep.ps1 b/azure-ps/bicep/az-ps-deploy-bicep.ps1 index e61ef5b..a48c8f0 100644 --- a/azure-ps/bicep/az-ps-deploy-bicep.ps1 +++ b/azure-ps/bicep/az-ps-deploy-bicep.ps1 @@ -45,7 +45,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" New-AzResourceGroupDeployment ` -ResourceGroupName $AzResourceGroupName ` diff --git a/azure-ps/wip_az-ps-create-image-avd.ps1 b/azure-ps/wip_az-ps-create-image-avd.ps1 index 7582f3f..36ed42d 100644 --- a/azure-ps/wip_az-ps-create-image-avd.ps1 +++ b/azure-ps/wip_az-ps-create-image-avd.ps1 @@ -34,7 +34,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Prerequisites # Check to ensure that you're registered for the providers and RegistrationState is set to 'Registered' diff --git a/azure-ps/wip_az-ps-create-windows-vm.ps1 b/azure-ps/wip_az-ps-create-windows-vm.ps1 index 707eb96..e38492e 100644 --- a/azure-ps/wip_az-ps-create-windows-vm.ps1 +++ b/azure-ps/wip_az-ps-create-windows-vm.ps1 @@ -55,6 +55,7 @@ param( [Parameter(Mandatory)] [string]$AzVmName, [Parameter(Mandatory)] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] [string]$AzLocation, [Parameter(Mandatory)] [string]$AzImageName, @@ -71,7 +72,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" New-AzResourceGroup -Name $AzResourceGroupName -Location eastus diff --git a/azure-ps/wip_az-ps-image-builder-windows.ps1 b/azure-ps/wip_az-ps-image-builder-windows.ps1 index 13e5205..c4a4373 100644 --- a/azure-ps/wip_az-ps-image-builder-windows.ps1 +++ b/azure-ps/wip_az-ps-image-builder-windows.ps1 @@ -34,7 +34,7 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" #Prerequisites Install-Module -Name Az.ImageBuilder diff --git a/templates/template.ps1 b/templates/template.ps1 index c116940..adc1f75 100644 --- a/templates/template.ps1 +++ b/templates/template.ps1 @@ -30,6 +30,6 @@ param( ) #Set Error Action to Silently Continue -$ErrorActionPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" # Add your code here... From f72c06fd6734edae197541a018524dfaaa0d2e08 Mon Sep 17 00:00:00 2001 From: Sinisa Sokolic Date: Tue, 23 Apr 2024 20:21:46 +0200 Subject: [PATCH 3/4] additional changes to parameters and default values --- aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 | 4 +- aws-cli/ec2/aws-cli-create-ec2-instance.ps1 | 8 ++-- aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 | 2 +- aws-cli/ec2/aws-cli-start-instance.ps1 | 4 +- aws-cli/ec2/aws-cli-stop-instance.ps1 | 2 +- aws-cli/ec2/aws-cli-terminate-instance.ps1 | 4 +- aws-cli/network/aws-cli-create-subnet.ps1 | 8 ++-- .../organizations/aws-cli-create-account.ps1 | 4 +- .../aws-cli-authorize-ec2-security-group | 8 ++-- .../aws-cli-delete-ec2-security-group.ps1 | 2 +- ...wip_aws-cli-create-ec2-security-group.ps1} | 6 +-- aws-cli/storage/aws-cli-create-s3-bucket.ps1 | 5 ++- aws-cli/workspaces/aws-cli-create-tag.ps1 | 2 +- aws-cli/workspaces/aws-cli-delete-tag.ps1 | 2 +- ...aws-cli-deregister-workspace-directory.ps1 | 2 +- .../workspaces/aws-cli-migrate-workspace.ps1 | 4 +- .../aws-cli-modify-workspace-state.ps1 | 4 +- .../workspaces/aws-cli-reboot-workspace.ps1 | 2 +- .../workspaces/aws-cli-rebuild-workspace.ps1 | 2 +- .../aws-cli-register-workspace-directory.ps1 | 2 +- .../workspaces/aws-cli-restore-workspace.ps1 | 2 +- .../workspaces/aws-cli-start-workspace.ps1 | 2 +- aws-cli/workspaces/aws-cli-stop-worksapce.ps1 | 2 +- .../aws-cli-terminate-workspace.ps1 | 2 +- .../wip_aws-cli-create-workspace.ps1 | 4 +- ...i-modify-workspace-creation-properties.ps1 | 2 +- aws-cli/xoap/aws-cli-register-node.ps1 | 12 +++--- aws-ps/workspaces/aws-ps-create-workspace.ps1 | 6 +-- aws-ps/workspaces/aws-ps-reboot-workspace.ps1 | 2 +- .../az-cli-create-avd-application-group.ps1 | 7 ++-- azure-cli/avd/az-cli-create-avd-workspace.ps1 | 6 +-- azure-cli/avd/az-cli-update-avd-hostpool.ps1 | 6 +-- azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 | 8 ++-- .../network/az-cli-create-virtual-network.ps1 | 10 ++--- .../az-cli-create-resource-group.ps1 | 2 +- .../az-cli-delete-resource-group.ps1 | 2 +- azure-cli/security/wip_az-cli-create-nsg.ps1 | 2 +- .../storage/az-cli-create-storage-account.ps1 | 4 +- .../vms/az-cli-create-image-definition.ps1 | 8 ++-- .../wip_az-cli-create-image-builder-linux.ps1 | 2 +- ...ip_az-cli-create-image-builder-windows.ps1 | 2 +- azure-cli/vms/wip_az-cli-create-linux-vm.ps1 | 2 +- .../vms/wip_az-cli-create-specialized-vm.ps1 | 2 +- .../wip_az-cli-delete-image-builder-linux.ps1 | 3 +- azure-ps/az-ps-create-resource-group.ps1 | 2 +- azure-ps/az-ps-create-vm-scale-set.ps1 | 11 +++--- azure-ps/az-ps-delete-resource-group.ps1 | 2 +- .../az-ps-image-builder-windows-cleanup.ps1 | 4 +- azure-ps/az-ps-install-nginx-linux-vm.ps1 | 4 +- azure-ps/az-ps-install-webserver-windows.ps1 | 4 +- azure-ps/bicep/az-ps-deploy-bicep.ps1 | 6 +-- azure-ps/wip_az-ps-create-image-avd.ps1 | 5 ++- azure-ps/wip_az-ps-create-windows-vm.ps1 | 17 +++++---- azure-ps/wip_az-ps-image-builder-windows.ps1 | 5 ++- templates/template.ps1 | 37 ++++++++++++++++++- 55 files changed, 157 insertions(+), 117 deletions(-) rename aws-cli/security/{aws-cli-create-ec2-security-group.ps1 => wip_aws-cli-create-ec2-security-group.ps1} (91%) diff --git a/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 b/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 index e0798a5..ab3149d 100644 --- a/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 +++ b/aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1 @@ -33,9 +33,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsInstanceId, + [string]$AwsInstanceId = "myInstanceId", [Parameter(Mandatory)] - [string]$AwsElasticIpId + [string]$AwsElasticIpId = "myElasticIpId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 b/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 index 2e0996e..862c210 100644 --- a/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 +++ b/aws-cli/ec2/aws-cli-create-ec2-instance.ps1 @@ -46,16 +46,16 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsAmiId, + [string]$AwsAmiId = "myAmiId", [Parameter(Mandatory)] - [int]$AwsInstanceCount, + [int]$AwsInstanceCount = 1, [Parameter(Mandatory)] [ValidateSet('t2.micro', 't2.small', 't2.medium', 't2.large', 'm4.large', 'm4.xlarge', 'm4.2xlarge', 'm4.4xlarge', 'm4.10xlarge', 'm4.16xlarge', 'm5.large', 'm5.xlarge', 'm5.2xlarge', 'm5.4xlarge', 'm5.12xlarge', 'm5.24xlarge', 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', 'c4.large', 'c4.xlarge', 'c4.2xlarge', 'c4.4xlarge', 'c4.8xlarge', 'c5.large', 'c5.xlarge', 'c5.2xlarge', 'c5.4xlarge', 'c5.9xlarge', 'c5.18xlarge', 'c5d.large', 'c5d.xlarge', 'c5d.2xlarge', 'c5d.4xlarge', 'c5d.9xlarge', 'c5d.18xlarge', 'r4.large', 'r4.xlarge', 'r4.2xlarge', 'r4.4xlarge', 'r4.8xlarge', 'r4.16xlarge', 'r5.large', 'r5.xlarge', 'r5.2xlarge', 'r5.4xlarge', 'r5.12xlarge', 'r5.24xlarge', 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', 'i3.large', 'i3.xlarge', 'i3.2xlarge', 'i3.4xlarge', 'i3.8xlarge', 'i3.16xlarge', 'i3en.large', 'i3en.xlarge', 'i3en.2xlarge', 'i3en.3xlarge')] [string]$AwsInstanceType, [Parameter(Mandatory)] - [string]$AwsKeyPairName, + [string]$AwsKeyPairName = "myKeyPairName", [Parameter(Mandatory)] - [string]$AwsSecurityGroupId + [string]$AwsSecurityGroupId = "mySecurityGroupId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 b/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 index 5f42af4..021c72e 100644 --- a/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 +++ b/aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1 @@ -32,7 +32,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsKeyPairName + [string]$AwsKeyPairName = "myKeyPair" ) #Set Error Action to Silently Continue diff --git a/aws-cli/ec2/aws-cli-start-instance.ps1 b/aws-cli/ec2/aws-cli-start-instance.ps1 index 7876a7c..0379ee0 100644 --- a/aws-cli/ec2/aws-cli-start-instance.ps1 +++ b/aws-cli/ec2/aws-cli-start-instance.ps1 @@ -19,7 +19,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + AWS CLI .LINK https://github.com/xoap-io/scripted-actions @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsInstanceId + [string]$AwsInstanceId = "myInstanceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/ec2/aws-cli-stop-instance.ps1 b/aws-cli/ec2/aws-cli-stop-instance.ps1 index 751e80c..969fa47 100644 --- a/aws-cli/ec2/aws-cli-stop-instance.ps1 +++ b/aws-cli/ec2/aws-cli-stop-instance.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsInstanceId + [string]$AwsInstanceId = "myInstanceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/ec2/aws-cli-terminate-instance.ps1 b/aws-cli/ec2/aws-cli-terminate-instance.ps1 index 094e67e..487df87 100644 --- a/aws-cli/ec2/aws-cli-terminate-instance.ps1 +++ b/aws-cli/ec2/aws-cli-terminate-instance.ps1 @@ -19,7 +19,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + AWS CLI .LINK https://github.com/xoap-io/scripted-actions @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsInstanceId + [string]$AwsInstanceId = "myInstanceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/network/aws-cli-create-subnet.ps1 b/aws-cli/network/aws-cli-create-subnet.ps1 index 46d3929..5d1599f 100644 --- a/aws-cli/network/aws-cli-create-subnet.ps1 +++ b/aws-cli/network/aws-cli-create-subnet.ps1 @@ -40,13 +40,13 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsVpcId, + [string]$AwsVpcId = "myVpcId", [Parameter(Mandatory)] - [string]$AwsCidrBlock, + [string]$AwsCidrBlock = "myCidrBlock", [Parameter(Mandatory)] - [string]$AwsIpv6CidrBlock, + [string]$AwsIpv6CidrBlock = "myIpv6CidrBlock", [Parameter(Mandatory)] - [string]$AwsTagSpecifications + [string]$AwsTagSpecifications = "myTagSpecifications" ) #Set Error Action to Silently Continue diff --git a/aws-cli/organizations/aws-cli-create-account.ps1 b/aws-cli/organizations/aws-cli-create-account.ps1 index f4799f2..1d56853 100644 --- a/aws-cli/organizations/aws-cli-create-account.ps1 +++ b/aws-cli/organizations/aws-cli-create-account.ps1 @@ -34,9 +34,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsAccountEmail, + [string]$AwsAccountEmail = "myEmail", [Parameter(Mandatory)] - [string]$AwsAccountName + [string]$AwsAccountName = "myAccountName" ) #Set Error Action to Silently Continue diff --git a/aws-cli/security/aws-cli-authorize-ec2-security-group b/aws-cli/security/aws-cli-authorize-ec2-security-group index 3544271..63a5d38 100644 --- a/aws-cli/security/aws-cli-authorize-ec2-security-group +++ b/aws-cli/security/aws-cli-authorize-ec2-security-group @@ -40,13 +40,13 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsSecurityGroupId, + [string]$AwsSecurityGroupId = "sg-1234567890abcdef0", [Parameter(Mandatory)] - [string]$AwsSecurityGroupProtocol, + [string]$AwsSecurityGroupProtocol = "tcp", [Parameter(Mandatory)] - [string]$AwsSecurityGroupPort, + [string]$AwsSecurityGroupPort = "80", [Parameter(Mandatory)] - [string]$AwsSecurityGroupCidr + [string]$AwsSecurityGroupCidr = "10.0.0.0/16" ) diff --git a/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 b/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 index fc10d5b..edf0a14 100644 --- a/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 +++ b/aws-cli/security/aws-cli-delete-ec2-security-group.ps1 @@ -36,7 +36,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsSecurityGroupId + [string]$AwsSecurityGroupId = "mySecurityGroupId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/security/aws-cli-create-ec2-security-group.ps1 b/aws-cli/security/wip_aws-cli-create-ec2-security-group.ps1 similarity index 91% rename from aws-cli/security/aws-cli-create-ec2-security-group.ps1 rename to aws-cli/security/wip_aws-cli-create-ec2-security-group.ps1 index 3f61b65..852b699 100644 --- a/aws-cli/security/aws-cli-create-ec2-security-group.ps1 +++ b/aws-cli/security/wip_aws-cli-create-ec2-security-group.ps1 @@ -37,11 +37,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsSecurityGroupName, + [string]$AwsSecurityGroupName = "mySecurityGroup", [Parameter(Mandatory)] - [string]$AwsSecurityGroupDescription, + [string]$AwsSecurityGroupDescription = "MySecurityGroupDescription", [Parameter(Mandatory)] - [string]$AwsVpcId + [string]$AwsVpcId = "myVpcId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/storage/aws-cli-create-s3-bucket.ps1 b/aws-cli/storage/aws-cli-create-s3-bucket.ps1 index 26f5277..aa5ea35 100644 --- a/aws-cli/storage/aws-cli-create-s3-bucket.ps1 +++ b/aws-cli/storage/aws-cli-create-s3-bucket.ps1 @@ -34,9 +34,10 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsBucketName, + [string]$AwsBucketName = "myBucketName", [Parameter(Mandatory)] - [string]$AwsBucketRegion + [ValidateSet('af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-southeast-1','ap-southeast-2','ca-central-1','eu-central-1','eu-north-1','eu-south-1','eu-west-1','eu-west-2','eu-west-3','me-south-1','sa-east-1','us-east-1','us-east-2','us-west-1','us-west-2')] + [string]$AwsBucketRegion = "myBucketRegion" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-create-tag.ps1 b/aws-cli/workspaces/aws-cli-create-tag.ps1 index 7da5f7c..8f411f8 100644 --- a/aws-cli/workspaces/aws-cli-create-tag.ps1 +++ b/aws-cli/workspaces/aws-cli-create-tag.ps1 @@ -33,7 +33,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-delete-tag.ps1 b/aws-cli/workspaces/aws-cli-delete-tag.ps1 index 687091a..a4fea9d 100644 --- a/aws-cli/workspaces/aws-cli-delete-tag.ps1 +++ b/aws-cli/workspaces/aws-cli-delete-tag.ps1 @@ -34,7 +34,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 b/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 index 8a9a4c0..c9fbea7 100644 --- a/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 +++ b/aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsDirectoryId + [string]$AwsDirectoryId = "myDirectoryId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 b/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 index c150e9e..130cfac 100644 --- a/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-migrate-workspace.ps1 @@ -34,9 +34,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsSourceWorkspaceId, + [string]$AwsSourceWorkspaceId = "myWorkspaceId", [Parameter(Mandatory)] - [string]$AwsWorkspaceBundleId + [string]$AwsWorkspaceBundleId = "myWorkspaceBundleId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 b/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 index a406f40..a9283e3 100644 --- a/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 +++ b/aws-cli/workspaces/aws-cli-modify-workspace-state.ps1 @@ -34,9 +34,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId, + [string]$AwsWorkspaceId = "myWorkspaceId", [Parameter(Mandatory)] - [string]$AWsWorkspaceState + [string]$AWsWorkspaceState = "myWorkspaceState" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 b/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 index 0b6789e..418a8f7 100644 --- a/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-reboot-workspace.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 b/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 index 1451040..ff427a1 100644 --- a/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-rebuild-workspace.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 b/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 index 3f1a964..f56a98d 100644 --- a/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 +++ b/aws-cli/workspaces/aws-cli-register-workspace-directory.ps1 @@ -30,7 +30,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsDirectoryId + [string]$AwsDirectoryId = "myDirectoryId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-restore-workspace.ps1 b/aws-cli/workspaces/aws-cli-restore-workspace.ps1 index 4cf2933..6277da7 100644 --- a/aws-cli/workspaces/aws-cli-restore-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-restore-workspace.ps1 @@ -34,7 +34,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-start-workspace.ps1 b/aws-cli/workspaces/aws-cli-start-workspace.ps1 index 3a4be86..82b98d8 100644 --- a/aws-cli/workspaces/aws-cli-start-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-start-workspace.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 b/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 index a953bbc..b80c5ad 100644 --- a/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 +++ b/aws-cli/workspaces/aws-cli-stop-worksapce.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName + [string]$AzResourceGroupName = "myResourceGroupName" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 b/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 index edc2f32..77a19e8 100644 --- a/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 +++ b/aws-cli/workspaces/aws-cli-terminate-workspace.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 b/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 index e4cf926..0e1edc5 100644 --- a/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 +++ b/aws-cli/workspaces/wip_aws-cli-create-workspace.ps1 @@ -26,12 +26,12 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName + [string]$AzResourceGroupName = 'myResourceGroup' ) #Set Error Action to Silently Continue $ErrorActionPreference = "Stop" aws workspaces create-workspaces ` - --workspaces DirectoryId=string,UserName=string,BundleId=string,VolumeEncryptionKey=string,UserVolumeEncryptionEnabled=boolean,RootVolumeEncryptionEnabled=boolean,WorkspaceProperties={RunningMode=string,RunningModeAutoStopTimeoutInMinutes=integer,RootVolumeSizeGib=integer,UserVolumeSizeGib=integer,ComputeTypeName=string,Protocols=[string,string],OperatingSystemName=string},Tags=[{Key=string,Value=string},{Key=string,Value=string}],WorkspaceName=string + --workspaces "DirectoryId=string,UserName=string,BundleId=string,VolumeEncryptionKey=string,UserVolumeEncryptionEnabled=boolean,RootVolumeEncryptionEnabled=boolean,WorkspaceProperties={RunningMode=string,RunningModeAutoStopTimeoutInMinutes=integer,RootVolumeSizeGib=integer,UserVolumeSizeGib=integer,ComputeTypeName=string,Protocols=[string,string],OperatingSystemName=string},Tags=[{Key=string,Value=string},{Key=string,Value=string}],WorkspaceName=string" \ No newline at end of file diff --git a/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 b/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 index 4adf8a9..5e6b2cd 100644 --- a/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 +++ b/aws-cli/workspaces/wip_aws-cli-modify-workspace-creation-properties.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/aws-cli/xoap/aws-cli-register-node.ps1 b/aws-cli/xoap/aws-cli-register-node.ps1 index e352cdb..a991f18 100644 --- a/aws-cli/xoap/aws-cli-register-node.ps1 +++ b/aws-cli/xoap/aws-cli-register-node.ps1 @@ -43,21 +43,21 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsInstanceId, + [string]$AwsInstanceId = "myInstanceId", [Parameter(Mandatory)] - [string]$AwsSsmDocumentName, + [string]$AwsSsmDocumentName = "myDocumentName", [Parameter(Mandatory)] - [string]$AwsSsmDocumentComment, + [string]$AwsSsmDocumentComment = "myDocumentComment", [Parameter(Mandatory)] - [string]$XOAPWorkspaceId, + [string]$XOAPWorkspaceId = "myWorkspaceId", [Parameter(Mandatory)] - [string]$XOAPGroupName + [string]$XOAPGroupName = "XOAP unassigned" ) #Set Error Action to Silently Continue $ErrorActionPreference = "Stop" -$runPSCommand = Send-SSMCommand ` +Send-SSMCommand ` -InstanceIds @($AwsInstanceId) ` -DocumentName $AwsSsmDocumentName ` -Comment $AwsSsmDocumentComment ` diff --git a/aws-ps/workspaces/aws-ps-create-workspace.ps1 b/aws-ps/workspaces/aws-ps-create-workspace.ps1 index 08568d0..d383aa9 100644 --- a/aws-ps/workspaces/aws-ps-create-workspace.ps1 +++ b/aws-ps/workspaces/aws-ps-create-workspace.ps1 @@ -36,11 +36,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceBundleIdBundleId, + [string]$AwsWorkspaceBundleIdBundleId = "myBundleId", [Parameter(Mandatory)] - [string]$AwsWorkspaceDirectoryId, + [string]$AwsWorkspaceDirectoryId = "myDirectoryId", [Parameter(Mandatory)] - [string]$AwsWorkspaceUserName + [string]$AwsWorkspaceUserName = "myUserName" ) #Set Error Action to Silently Continue diff --git a/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 b/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 index 9af8003..1ca3f27 100644 --- a/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 +++ b/aws-ps/workspaces/aws-ps-reboot-workspace.ps1 @@ -31,7 +31,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AwsWorkspaceId + [string]$AwsWorkspaceId = "myWorkspaceId" ) #Set Error Action to Silently Continue diff --git a/azure-cli/avd/az-cli-create-avd-application-group.ps1 b/azure-cli/avd/az-cli-create-avd-application-group.ps1 index b662a8e..a83a321 100644 --- a/azure-cli/avd/az-cli-create-avd-application-group.ps1 +++ b/azure-cli/avd/az-cli-create-avd-application-group.ps1 @@ -40,12 +40,13 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzApplicationGroupName, + [string]$AzApplicationGroupName = "myApplicationGroup", [Parameter(Mandatory)] - [string]$AzHostPoolArmPath, + [string]$AzHostPoolArmPath = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DesktopVirtualization/hostPools/myHostPool", [Parameter(Mandatory)] + [ValidateSet('Desktop', 'RemoteApp')] [string]$AzHostPoolType ) diff --git a/azure-cli/avd/az-cli-create-avd-workspace.ps1 b/azure-cli/avd/az-cli-create-avd-workspace.ps1 index 27be0e4..0432109 100644 --- a/azure-cli/avd/az-cli-create-avd-workspace.ps1 +++ b/azure-cli/avd/az-cli-create-avd-workspace.ps1 @@ -38,11 +38,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzWorkspaceName, + [string]$AzWorkspaceName = "myWorkspace", [Parameter(Mandatory)] - [string]$AzWorkspaceFrindlyName + [string]$AzWorkspaceFrindlyName = "myFriendlyName" ) #Set Error Action to Silently Continue diff --git a/azure-cli/avd/az-cli-update-avd-hostpool.ps1 b/azure-cli/avd/az-cli-update-avd-hostpool.ps1 index 1f289e2..cd770e5 100644 --- a/azure-cli/avd/az-cli-update-avd-hostpool.ps1 +++ b/azure-cli/avd/az-cli-update-avd-hostpool.ps1 @@ -38,11 +38,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzHostPoolName, + [string]$AzHostPoolName = "myHostPool", [Parameter(Mandatory)] - [string]$AzTags + [string]$AzTags = "myTags" ) #Set Error Action to Silently Continue diff --git a/azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 b/azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 index 024635e..0d6def5 100644 --- a/azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 +++ b/azure-cli/bicep/wip_az-cli-deploy-bicep.ps1 @@ -26,7 +26,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + Azure CLI .LINK https://github.com/xoap-io/scripted-actions @@ -44,11 +44,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$BicepTemplateFile, + [string]$BicepTemplateFile = "myBicepTemplate.bicep", [Parameter(Mandatory)] - [string]$BicepTemplateParametersFile + [string]$BicepTemplateParametersFile = "myBicepTemplateParameters.json" ) #Set Error Action to Silently Continue diff --git a/azure-cli/network/az-cli-create-virtual-network.ps1 b/azure-cli/network/az-cli-create-virtual-network.ps1 index 8064f8d..034e9a4 100644 --- a/azure-cli/network/az-cli-create-virtual-network.ps1 +++ b/azure-cli/network/az-cli-create-virtual-network.ps1 @@ -44,15 +44,15 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzVnetName, + [string]$AzVnetName = "myVnet", [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzVnetAddressPrefix, + [string]$AzVnetAddressPrefix ="10.0.0.0/16", [Parameter(Mandatory)] - [string]$AzSubnetName, + [string]$AzSubnetName = "mySubnet", [Parameter(Mandatory)] - [string]$AzSsubnetAddressPrefix + [string]$AzSsubnetAddressPrefix = "10.0.0.0/24" ) #Set Error Action to Silently Continue diff --git a/azure-cli/resource-manager/az-cli-create-resource-group.ps1 b/azure-cli/resource-manager/az-cli-create-resource-group.ps1 index fbf0542..c6037f5 100644 --- a/azure-cli/resource-manager/az-cli-create-resource-group.ps1 +++ b/azure-cli/resource-manager/az-cli-create-resource-group.ps1 @@ -35,7 +35,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral', 'westcentralus', 'southcentralus', 'southcentralus', 'centralus', 'northcentralus', 'eastus2euap', 'westus3', 'southeastasia', 'eastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'canadacentral', 'canadaeast', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'norwayeast', 'norwaywest', 'switzerlandnorth', 'switzerlandwest', 'germanynorth', 'germanywestcentral', 'uaenorth', 'uaecentral', 'southafricanorth', 'southafricawest', 'brazilsouth', 'brazilus', 'koreacentral', 'koreasouth', 'koreasouth', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'canadacentral', 'canadaeast', 'centralindia', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'francecentral', 'francesouth', 'germanywestcentral', 'japaneast', 'japanwest', 'northcentralus', 'northeurope', 'southafricanorth', 'southcentralus', 'southeastasia', 'switzerlandnorth', 'switzerlandwest', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2')] [string]$AzLocation diff --git a/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 b/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 index 40d0c71..194bc5a 100644 --- a/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 +++ b/azure-cli/resource-manager/az-cli-delete-resource-group.ps1 @@ -36,7 +36,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName + [string]$AzResourceGroupName = "myResourceGroup" ) #Set Error Action to Silently Continue diff --git a/azure-cli/security/wip_az-cli-create-nsg.ps1 b/azure-cli/security/wip_az-cli-create-nsg.ps1 index 994c540..262e84d 100644 --- a/azure-cli/security/wip_az-cli-create-nsg.ps1 +++ b/azure-cli/security/wip_az-cli-create-nsg.ps1 @@ -14,7 +14,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + Azure CLI .LINK https://github.com/xoap-io/scripted-actions diff --git a/azure-cli/storage/az-cli-create-storage-account.ps1 b/azure-cli/storage/az-cli-create-storage-account.ps1 index 9e8972c..fafeec4 100644 --- a/azure-cli/storage/az-cli-create-storage-account.ps1 +++ b/azure-cli/storage/az-cli-create-storage-account.ps1 @@ -41,12 +41,12 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral', 'westcentralus', 'southcentralus', 'southcentralus', 'centralus', 'northcentralus', 'eastus2euap', 'westus3', 'southeastasia', 'eastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'canadacentral', 'canadaeast', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'norwayeast', 'norwaywest', 'switzerlandnorth', 'switzerlandwest', 'germanynorth', 'germanywestcentral', 'uaenorth', 'uaecentral', 'southafricanorth', 'southafricawest', 'brazilsouth', 'brazilus', 'koreacentral', 'koreasouth', 'koreasouth', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'canadacentral', 'canadaeast', 'centralindia', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'francecentral', 'francesouth', 'germanywestcentral', 'japaneast', 'japanwest', 'northcentralus', 'northeurope', 'southafricanorth', 'southcentralus', 'southeastasia', 'switzerlandnorth', 'switzerlandwest', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2')] [string]$AzLocation, [Parameter(Mandatory)] - [string]$AzStorageAccountName, + [string]$AzStorageAccountName = "myStorageAccount", [Parameter(Mandatory)] [ValidateSet('Premium_LRS', 'Premium_ZRS', 'Standard_GRS', 'Standard_GZRS', 'Standard_LRS', 'Standard_RAGRS', 'Standard_RAGZRS', 'Standard_ZRS')] [string]$AzStorageSku diff --git a/azure-cli/vms/az-cli-create-image-definition.ps1 b/azure-cli/vms/az-cli-create-image-definition.ps1 index 92208a8..eb5fac3 100644 --- a/azure-cli/vms/az-cli-create-image-definition.ps1 +++ b/azure-cli/vms/az-cli-create-image-definition.ps1 @@ -53,15 +53,15 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzGalleryName, + [string]$AzGalleryName = "myGallery", [Parameter(Mandatory)] - [string]$AzImageDefinition, + [string]$AzImageDefinition = "myImageDefinition", [Parameter(Mandatory)] [string]$AzImagePublisher = "MicrosoftWindowsDesktop", [Parameter(Mandatory)] - [string]$AzImageOffer, + [string]$AzImageOffer = "Windows-11", [Parameter(Mandatory)] [string]$AzImageSku = 'win11-23h2-entn', [Parameter(Mandatory)] diff --git a/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 b/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 index 243b9bb..d830487 100644 --- a/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 +++ b/azure-cli/vms/wip_az-cli-create-image-builder-linux.ps1 @@ -14,7 +14,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + Azure CLI .LINK https://github.com/scriptrunner/ActionPacks/tree/master/ActiveDirectory/Users diff --git a/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 b/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 index 134a40a..de7291c 100644 --- a/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 +++ b/azure-cli/vms/wip_az-cli-create-image-builder-windows.ps1 @@ -14,7 +14,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + Azure CLI .LINK https://github.com/scriptrunner/ActionPacks/tree/master/ActiveDirectory/Users diff --git a/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 b/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 index c0f850e..1a9cef5 100644 --- a/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 +++ b/azure-cli/vms/wip_az-cli-create-linux-vm.ps1 @@ -14,7 +14,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + Azure CLI .LINK https://github.com/scriptrunner/ActionPacks/tree/master/ActiveDirectory/Users diff --git a/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 b/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 index c9bf0e0..009ea31 100644 --- a/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 +++ b/azure-cli/vms/wip_az-cli-create-specialized-vm.ps1 @@ -14,7 +14,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + Azure CLI .LINK https://github.com/xoap-io/scripted-actions diff --git a/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 b/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 index 0232113..7b1261e 100644 --- a/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 +++ b/azure-cli/vms/wip_az-cli-delete-image-builder-linux.ps1 @@ -40,7 +40,8 @@ $ErrorActionPreference = "Stop" az resource delete ` --resource-group $sigResourceGroup ` --resource-type Microsoft.VirtualMachineImages/imageTemplates ` - -n helloImageTemplateforSIG01 + --name helloImageTemplateforSIG01 ` + --no-wait az role assignment delete ` --assignee $imgBuilderCliId ` diff --git a/azure-ps/az-ps-create-resource-group.ps1 b/azure-ps/az-ps-create-resource-group.ps1 index f034ac1..4fecafd 100644 --- a/azure-ps/az-ps-create-resource-group.ps1 +++ b/azure-ps/az-ps-create-resource-group.ps1 @@ -35,7 +35,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] [string]$AzLocation diff --git a/azure-ps/az-ps-create-vm-scale-set.ps1 b/azure-ps/az-ps-create-vm-scale-set.ps1 index 53b2d07..da2983d 100644 --- a/azure-ps/az-ps-create-vm-scale-set.ps1 +++ b/azure-ps/az-ps-create-vm-scale-set.ps1 @@ -53,18 +53,19 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzScaleSetName, + [string]$AzScaleSetName = "myScaleSet", [Parameter(Mandatory)] + [ValidateSet('Uniform', 'Flexible')] [string]$AzOrchestrationMode, [Parameter(Mandatory)] - [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzLocation, [Parameter(Mandatory)] - [int]$AzInstanceCount, + [int]$AzInstanceCount = 2, [Parameter(Mandatory)] - [string]$AzImageName + [string]$AzImageName = "myImageName" ) diff --git a/azure-ps/az-ps-delete-resource-group.ps1 b/azure-ps/az-ps-delete-resource-group.ps1 index 7dbfa7f..e5bb906 100644 --- a/azure-ps/az-ps-delete-resource-group.ps1 +++ b/azure-ps/az-ps-delete-resource-group.ps1 @@ -29,7 +29,7 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName + [string]$AzResourceGroupName = "myResourceGroup" ) #Set Error Action to Silently Continue diff --git a/azure-ps/az-ps-image-builder-windows-cleanup.ps1 b/azure-ps/az-ps-image-builder-windows-cleanup.ps1 index 82bc0db..e83ce6d 100644 --- a/azure-ps/az-ps-image-builder-windows-cleanup.ps1 +++ b/azure-ps/az-ps-image-builder-windows-cleanup.ps1 @@ -33,9 +33,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzImageTemplateName + [string]$AzImageTemplateName = "myImageTemplate" ) #Set Error Action to Silently Continue diff --git a/azure-ps/az-ps-install-nginx-linux-vm.ps1 b/azure-ps/az-ps-install-nginx-linux-vm.ps1 index 2ac4b27..c7fe844 100644 --- a/azure-ps/az-ps-install-nginx-linux-vm.ps1 +++ b/azure-ps/az-ps-install-nginx-linux-vm.ps1 @@ -34,9 +34,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzVmName + [string]$AzVmName = "myVm" ) #Set Error Action to Silently Continue diff --git a/azure-ps/az-ps-install-webserver-windows.ps1 b/azure-ps/az-ps-install-webserver-windows.ps1 index ca0ddbc..488ab44 100644 --- a/azure-ps/az-ps-install-webserver-windows.ps1 +++ b/azure-ps/az-ps-install-webserver-windows.ps1 @@ -34,9 +34,9 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzVmName + [string]$AzVmName = "myVm" ) #Set Error Action to Silently Continue diff --git a/azure-ps/bicep/az-ps-deploy-bicep.ps1 b/azure-ps/bicep/az-ps-deploy-bicep.ps1 index a48c8f0..1591a37 100644 --- a/azure-ps/bicep/az-ps-deploy-bicep.ps1 +++ b/azure-ps/bicep/az-ps-deploy-bicep.ps1 @@ -37,11 +37,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$BicepTemplateFile, + [string]$BicepTemplateFile = "myBicepTemplate.bicep", [Parameter(Mandatory)] - [string]$BicepTemplateParameterFile + [string]$BicepTemplateParameterFile = "myBicepTemplateParameters.json" ) #Set Error Action to Silently Continue diff --git a/azure-ps/wip_az-ps-create-image-avd.ps1 b/azure-ps/wip_az-ps-create-image-avd.ps1 index 36ed42d..58a27b9 100644 --- a/azure-ps/wip_az-ps-create-image-avd.ps1 +++ b/azure-ps/wip_az-ps-create-image-avd.ps1 @@ -26,11 +26,12 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] [string]$AZOpenPorts = '3389', [Parameter(Mandatory)] - [string]$AzVmSize + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] + [string]$AzVmSize ) #Set Error Action to Silently Continue diff --git a/azure-ps/wip_az-ps-create-windows-vm.ps1 b/azure-ps/wip_az-ps-create-windows-vm.ps1 index e38492e..fc6de00 100644 --- a/azure-ps/wip_az-ps-create-windows-vm.ps1 +++ b/azure-ps/wip_az-ps-create-windows-vm.ps1 @@ -51,23 +51,24 @@ param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AzVmName, + [string]$AzVmName = "myVm", [Parameter(Mandatory)] - [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] + [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral', 'westcentralus', 'southcentralus', 'southcentralus', 'centralus', 'northcentralus', 'eastus2euap', 'westus3', 'southeastasia', 'eastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'canadacentral', 'canadaeast', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'norwayeast', 'norwaywest', 'switzerlandnorth', 'switzerlandwest', 'germanynorth', 'germanywestcentral', 'uaenorth', 'uaecentral', 'southafricanorth', 'southafricawest', 'brazilsouth', 'brazilus', 'koreacentral', 'koreasouth', 'koreasouth', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'canadacentral', 'canadaeast', 'centralindia', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'francecentral', 'francesouth', 'germanywestcentral', 'japaneast', 'japanwest', 'northcentralus', 'northeurope', 'southafricanorth', 'southcentralus', 'southeastasia', 'switzerlandnorth', 'switzerlandwest', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2')] [string]$AzLocation, [Parameter(Mandatory)] - [string]$AzImageName, + [string]$AzImageName = "myImageName", [Parameter(Mandatory)] - [string]$AzPublicIpAddressName, + [string]$AzPublicIpAddressName = "myPublicIpAddressName", [Parameter(Mandatory)] - [string]$AzVmUserName, + [string]$AzVmUserName = "myVmUser", [Parameter(Mandatory)] - [securestring]$AzVmUserPassword, + [securestring]$AzVmUserPassword = "myVmPassword", [Parameter(Mandatory)] - [string]$AZOpenPorts = '3389', + [int]$AZOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) diff --git a/azure-ps/wip_az-ps-image-builder-windows.ps1 b/azure-ps/wip_az-ps-image-builder-windows.ps1 index c4a4373..8eff6a6 100644 --- a/azure-ps/wip_az-ps-image-builder-windows.ps1 +++ b/azure-ps/wip_az-ps-image-builder-windows.ps1 @@ -26,10 +26,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = "myResourceGroup", [Parameter(Mandatory)] - [string]$AZOpenPorts = '3389', + [int]$AZOpenPorts = '3389', [Parameter(Mandatory)] + [ValidateSet('Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', 'Standard_B20ms', 'Standard_B24ms', 'Standard_B1ls', 'Standard_B1s', 'Standard_B2s', 'Standard_B4s', 'Standard_B8s', 'Standard_B12s', 'Standard_B16s', 'Standard_B20s', 'Standard_B24s', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D48_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D48s_v3', 'Standard_D64s_v3', 'Standard_D2_v4', 'Standard_D4_v4', 'Standard_D8_v4', 'Standard_D16_v4', 'Standard_D32_v4', 'Standard_D48_v4', 'Standard_D64_v4', 'Standard_D2s_v4')] [string]$AzVmSize ) diff --git a/templates/template.ps1 b/templates/template.ps1 index adc1f75..195979f 100644 --- a/templates/template.ps1 +++ b/templates/template.ps1 @@ -14,7 +14,7 @@ PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG .COMPONENT - + PowerShell, Azure CLI, AWS Cli, Azure PowerShell .LINK https://github.com/xoap-io/scripted-actions @@ -25,8 +25,41 @@ #> [CmdletBinding()] param( + [string]$AzResourceGroupName = "myResourceGroup", + [Parameter(Mandatory)] + [ValidateRange(1024,49151)] + [string]$AZOpenPorts = '3389', + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] + [string]$AzVmSize, + [Parameter(Mandatory)] + [ValidateNotNullOrWhiteSpace()] + [string]$AzVmUserName, + [Parameter(Mandatory)] + [securestring]$AzVmUserPassword, + [Parameter(Mandatory)] + [ValidateSet("Flexible", "Uniform")] + [string]$AzOrchestrationMode = 'Flexible', + [ValidateSet('Premium_LRS', 'Premium_ZRS', 'Standard_GRS', 'Standard_GZRS', 'Standard_LRS', 'Standard_RAGRS', 'Standard_RAGZRS', 'Standard_ZRS')] + [string]$AzStorageSku, + [Parameter(Mandatory)] + [int]$AzVmCount = 1, + [Parameter(Mandatory)] + [datetime]$AzVmExpirationDate, + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty] + [switch]$AzVmAutoShutdown, + [Parameter(Mandatory=$False)] + [bool]$BooleanParameter=$False, [Parameter(Mandatory)] - [string]$AzResourceGroupName + [ValidateNotNull()] + [int]$AzSubnetCount, + [parameter(Position = 0, Mandatory)] + [ValidateNotNullOrEmpty()] + [ValidateScript({ Test-Path $_ })] + [string]$Path, + [Parameter(Mandatory=$false)] + [hashtable]$hashTableParam ) #Set Error Action to Silently Continue From 27baff6585fde0cd716a716f324db712c17ce57a Mon Sep 17 00:00:00 2001 From: Sinisa Sokolic Date: Tue, 23 Apr 2024 20:31:58 +0200 Subject: [PATCH 4/4] fixed merge conflicts --- azure-ps/az-ps-create-linux-vm.ps1 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/azure-ps/az-ps-create-linux-vm.ps1 b/azure-ps/az-ps-create-linux-vm.ps1 index 186151b..e294e51 100644 --- a/azure-ps/az-ps-create-linux-vm.ps1 +++ b/azure-ps/az-ps-create-linux-vm.ps1 @@ -53,13 +53,11 @@ [CmdletBinding()] param( [Parameter(Mandatory)] - [string]$AzResourceGroupName, + [string]$AzResourceGroupName = 'myResourceGroup', [Parameter(Mandatory)] - [string]$AzVmName, + [string]$AzVmName = 'myVmName', [Parameter(Mandatory)] -<<<<<<< HEAD - [ValidateSet('eastus', 'eastus2', 'germany', 'northeurope', 'germanywestcentral')] -======= + [ValidateSet( 'eastus', 'eastus2', 'southcentralus', 'westus2', 'westus3', 'australiaeast', 'southeastasia', 'northeurope', @@ -79,16 +77,15 @@ param( 'francesouth', 'germanynorth', 'norwaywest', 'switzerlandwest', 'ukwest', 'uaecentral', 'brazilsoutheast' )] ->>>>>>> d27ed172490c2a99af476a122f8fcfd7a8ae8575 [string]$AzLocation, [Parameter(Mandatory)] - [string]$AzImageName, + [string]$AzImageName = 'myImageName', [Parameter(Mandatory)] - [string]$AzPublicIpAddressName, + [string]$AzPublicIpAddressName = 'myPublicIpAddressName', [Parameter(Mandatory)] - [Securestring]$AZOpenPorts, + [int]$AZOpenPorts = 22, [Parameter(Mandatory)] - [string]$AzVmSize, + [string]$AzVmSize = 'Standard_B1s', [Parameter(Mandatory)] [string]$AzSshKeyName