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: