From d7e3e5374c4411fa8dd0de2a7b6af8aa3f04a6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCegsegger=20Philipp?= Date: Wed, 2 Feb 2022 14:26:52 +0100 Subject: [PATCH] Update Backup-GroupPolicy.ps1 fix folder creation --- Active-Directory/Backup-GroupPolicy.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Active-Directory/Backup-GroupPolicy.ps1 b/Active-Directory/Backup-GroupPolicy.ps1 index 157c3a2..6488856 100644 --- a/Active-Directory/Backup-GroupPolicy.ps1 +++ b/Active-Directory/Backup-GroupPolicy.ps1 @@ -91,7 +91,7 @@ param ( $Date = Get-Date -UFormat "%Y-%m-%d" $UpdatedPath = "$path\$date" - If (-Not $UpdatedPath) { New-item $UpdatedPath -ItemType directory | Out-Null } + If (-not $(Test-Path $UpdatedPath)) { New-item $UpdatedPath -ItemType directory | Out-Null } Write-Host "GPOs will be backed up to $UpdatedPath" -backgroundcolor white -foregroundColor red } #end of begin block