From de23094bc380883565288facee666d2634a51296 Mon Sep 17 00:00:00 2001 From: Chris Blyth Date: Thu, 1 Aug 2024 08:24:59 +0100 Subject: [PATCH] Make ensure directory do a try and create rather than fail if cannot be created --- src/Scripts/deployHelp.ps1 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Scripts/deployHelp.ps1 b/src/Scripts/deployHelp.ps1 index 3e6e24d9..fa48c851 100644 --- a/src/Scripts/deployHelp.ps1 +++ b/src/Scripts/deployHelp.ps1 @@ -101,14 +101,8 @@ function EnsurePath([string]$name) if ((Test-Path $path) -eq $False) { - if($path.StartsWith("\\")) - { - Write-Warning "Path '$path' does not exist or cannot be found by deployment user" - } - else - { - md $path - } + Write-Host "Path '$path' does not exist, try to create" + New-Item -ItemType Directory -Path $path -ErrorAction Continue } }