From 8f7c3c34f623e8e7c006eb7db6ba523da43ee4a2 Mon Sep 17 00:00:00 2001 From: frack113 <62423083+frack113@users.noreply.github.com> Date: Fri, 14 Jan 2022 22:58:09 +0100 Subject: [PATCH] Fix prereq_command (#1721) --- atomics/T1098.001/T1098.001.yaml | 4 ++-- atomics/T1110.001/T1110.001.yaml | 2 +- atomics/T1110.003/T1110.003.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/atomics/T1098.001/T1098.001.yaml b/atomics/T1098.001/T1098.001.yaml index 1dc75641..918f6c06 100644 --- a/atomics/T1098.001/T1098.001.yaml +++ b/atomics/T1098.001/T1098.001.yaml @@ -35,7 +35,7 @@ atomic_tests: - description: | AzureAD module must be installed. prereq_command: | - if (Get-Module AzureAD) {exit 0} else {exit 1} + try {if (Get-InstalledModule -Name AzureAD -ErrorAction SilentlyContinue) {exit 0} else {exit 1}} catch {exit 1} get_prereq_command: | Install-Module -Name AzureAD -Force executor: @@ -119,7 +119,7 @@ atomic_tests: - description: | AzureAD module must be installed. prereq_command: | - if (Get-Module AzureAD) {exit 0} else {exit 1} + try {if (Get-InstalledModule -Name AzureAD -ErrorAction SilentlyContinue) {exit 0} else {exit 1}} catch {exit 1} get_prereq_command: | Install-Module -Name AzureAD -Force executor: diff --git a/atomics/T1110.001/T1110.001.yaml b/atomics/T1110.001/T1110.001.yaml index 9104b6b7..0b87aa3c 100644 --- a/atomics/T1110.001/T1110.001.yaml +++ b/atomics/T1110.001/T1110.001.yaml @@ -92,7 +92,7 @@ atomic_tests: - description: | AzureAD module must be installed. prereq_command: | - if (Get-Module AzureAD) {exit 0} else {exit 1} + try {if (Get-InstalledModule -Name AzureAD -ErrorAction SilentlyContinue) {exit 0} else {exit 1}} catch {exit 1} get_prereq_command: | Install-Module -Name AzureAD -Force executor: diff --git a/atomics/T1110.003/T1110.003.yaml b/atomics/T1110.003/T1110.003.yaml index e4f85b21..87fdcf78 100644 --- a/atomics/T1110.003/T1110.003.yaml +++ b/atomics/T1110.003/T1110.003.yaml @@ -127,7 +127,7 @@ atomic_tests: - description: | AzureAD module must be installed. prereq_command: | - if (Get-Module AzureAD) {exit 0} else {exit 1} + try {if (Get-InstalledModule -Name AzureAD -ErrorAction SilentlyContinue) {exit 0} else {exit 1}} catch {exit 1} get_prereq_command: | Install-Module -Name AzureAD -Force executor: