From 34cc2baee5a725d16f26bef60298c65dbcf88f7a Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:21:12 +0100 Subject: [PATCH 1/8] DEVOPS-23: Added install of powershell --- azure-pipelines.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2b70589..156218d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,12 @@ stages: vmImage: ubuntu-latest displayName: Prepare jobs: + - job: test + displayName: 'Install powershell' + steps: + - template: azure-templates/prepare-project.yml + - script: Get-InstalledModule -Name Az -AllVersions + displayName: 'Check Powershell' - job: ScanAndBuild workspace: clean: all From fa75c12b067a9163398067e93b580eac5c436aaf Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:21:36 +0100 Subject: [PATCH 2/8] DEVOPS-23: Added prepare-project --- azure-templates/prepare-project.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 azure-templates/prepare-project.yml diff --git a/azure-templates/prepare-project.yml b/azure-templates/prepare-project.yml new file mode 100644 index 0000000..9711d89 --- /dev/null +++ b/azure-templates/prepare-project.yml @@ -0,0 +1,6 @@ +steps: + - task: Powershell@0 + displayName: 'Install Powershell' + - script: | + Install-Module -Name Az -AllowClobber -Scope AllUsers + displayName: 'Install Powershell' From e87a92dcd3f443c78e7f3bbeb78f20633ace0307 Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:23:15 +0100 Subject: [PATCH 3/8] Changed job name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 156218d..9509294 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,7 @@ stages: vmImage: ubuntu-latest displayName: Prepare jobs: - - job: test + - job: InstallPwsh displayName: 'Install powershell' steps: - template: azure-templates/prepare-project.yml From 92f43adcc438246706ed8d7b26fce968d4dae386 Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:32:48 +0100 Subject: [PATCH 4/8] DEVOPS-23: Powershell task change --- azure-templates/prepare-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-templates/prepare-project.yml b/azure-templates/prepare-project.yml index 9711d89..10ee203 100644 --- a/azure-templates/prepare-project.yml +++ b/azure-templates/prepare-project.yml @@ -1,5 +1,5 @@ steps: - - task: Powershell@0 + - task: Powershell@2 displayName: 'Install Powershell' - script: | Install-Module -Name Az -AllowClobber -Scope AllUsers From 9dbe4c296156d123f7a2364c231ee6f9a7619d0f Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:37:29 +0100 Subject: [PATCH 5/8] DEVOPS-23: Fixing Powershell install --- azure-templates/prepare-project.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-templates/prepare-project.yml b/azure-templates/prepare-project.yml index 10ee203..3beb54e 100644 --- a/azure-templates/prepare-project.yml +++ b/azure-templates/prepare-project.yml @@ -1,6 +1,7 @@ steps: - - task: Powershell@2 - displayName: 'Install Powershell' - - script: | - Install-Module -Name Az -AllowClobber -Scope AllUsers + - task: PowerShell@2 displayName: 'Install Powershell' + inputs: + targetType: 'inline' + script: | + Install-Module -Name Az -AllowClobber -Scope AllUsers From 2c1c6c5efa4553ae274fc173ab89076c37f9b0a4 Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:42:44 +0100 Subject: [PATCH 6/8] Fixing Powershell check --- azure-pipelines.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9509294..8c189ae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,8 +20,12 @@ stages: displayName: 'Install powershell' steps: - template: azure-templates/prepare-project.yml - - script: Get-InstalledModule -Name Az -AllVersions - displayName: 'Check Powershell' + - task: PowerShell@2 + displayName: 'Check Azure PowerShell' + inputs: + targetType: 'inline' + script: | + Get-InstalledModule -Name Az -AllVersions - job: ScanAndBuild workspace: clean: all From 05acbeae1b816cfb80b1e869101355e10886e9c7 Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:45:22 +0100 Subject: [PATCH 7/8] Added -Force to install --- azure-templates/prepare-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-templates/prepare-project.yml b/azure-templates/prepare-project.yml index 3beb54e..b185b6a 100644 --- a/azure-templates/prepare-project.yml +++ b/azure-templates/prepare-project.yml @@ -4,4 +4,4 @@ steps: inputs: targetType: 'inline' script: | - Install-Module -Name Az -AllowClobber -Scope AllUsers + Install-Module -Name Az -AllowClobber -Scope AllUsers -Force From be6221615bc2088e5fc9be244aafb994820ed66d Mon Sep 17 00:00:00 2001 From: gaboraszt Date: Wed, 31 Jan 2024 14:49:04 +0100 Subject: [PATCH 8/8] DEVOPS-23: Changed powershell install command --- azure-templates/prepare-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-templates/prepare-project.yml b/azure-templates/prepare-project.yml index b185b6a..e520253 100644 --- a/azure-templates/prepare-project.yml +++ b/azure-templates/prepare-project.yml @@ -4,4 +4,4 @@ steps: inputs: targetType: 'inline' script: | - Install-Module -Name Az -AllowClobber -Scope AllUsers -Force + Install-Module -Name Az -AllowClobber -Scope CurrentUser -Force