From b0972183e1419bb2558c41b8b4122355d2720bca Mon Sep 17 00:00:00 2001 From: Vishnu Priya Ananthu Sundaram Date: Sun, 13 Nov 2016 13:02:34 -0800 Subject: [PATCH 1/2] Script to run the pester tests This script will import bootstrapper module and pester module (if not already installed & imported) and run the unit tests. --- tools/AzureRM.BootStrapper/Run-UnitTests.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tools/AzureRM.BootStrapper/Run-UnitTests.ps1 diff --git a/tools/AzureRM.BootStrapper/Run-UnitTests.ps1 b/tools/AzureRM.BootStrapper/Run-UnitTests.ps1 new file mode 100644 index 000000000000..b4514780ccfc --- /dev/null +++ b/tools/AzureRM.BootStrapper/Run-UnitTests.ps1 @@ -0,0 +1,12 @@ +Import-Module -Name AzureRM.Bootstrapper + +if ((Get-Module -Name Pester) -eq $null) +{ + Find-Module –Name 'Pester' | Install-Module + Import-Module -Name 'Pester' +} + +$defaults = [System.IO.Path]::GetDirectoryName($PSCommandPath) +cd $defaults + +Invoke-Pester From 91d510ba33dd434e0cf7e4968921e987ca832041 Mon Sep 17 00:00:00 2001 From: Vishnu Priya Ananthu Sundaram Date: Tue, 15 Nov 2016 09:56:49 -0800 Subject: [PATCH 2/2] Replacing Import-Module with #Requires #Requires Bootstrapper & Pester modules --- tools/AzureRM.BootStrapper/Run-UnitTests.ps1 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/AzureRM.BootStrapper/Run-UnitTests.ps1 b/tools/AzureRM.BootStrapper/Run-UnitTests.ps1 index b4514780ccfc..eda1b0d53b27 100644 --- a/tools/AzureRM.BootStrapper/Run-UnitTests.ps1 +++ b/tools/AzureRM.BootStrapper/Run-UnitTests.ps1 @@ -1,10 +1,4 @@ -Import-Module -Name AzureRM.Bootstrapper - -if ((Get-Module -Name Pester) -eq $null) -{ - Find-Module –Name 'Pester' | Install-Module - Import-Module -Name 'Pester' -} +#Requires -Modules AzureRM.Bootstrapper, Pester $defaults = [System.IO.Path]::GetDirectoryName($PSCommandPath) cd $defaults