Common/RestartPowerShell.ps1
Param( [string]$SAFCommand ) $ErrorActionPreference = "Stop" $modulePaths = @( "D:\Projects\SAF\Src\PowerShell-Module\Sitecore.Automation.Framework.psm1", "C:\Projects\SAF\Src\PowerShell-Module\Sitecore.Automation.Framework.psm1" ) $importedFromLocalSource = $false foreach ($path in $modulePaths) { if (Test-Path $path) { Import-Module -Name $path -Force $importedFromLocalSource = $true break } } if (!$importedFromLocalSource) { Get-Module -Name Sitecore.Automation.Framework | Remove-Module -Force Import-Module -Name Sitecore.Automation.Framework } Invoke-Expression $SAFCommand |