From b9c0127e83ae27287c3a8d8fbcff0ff2fd6999e1 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 24 Sep 2024 14:10:01 -0700 Subject: [PATCH] Fix cleanup in PSResourceGet test (#24339) --- ...Microsoft.PowerShell.PSResourceGet.Tests.ps1 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.Tests.ps1 index b06f0aa427..01f9a90127 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.Tests.ps1 @@ -331,6 +331,14 @@ Describe "PSResourceGet - Script tests (Admin)" -Tags @('Feature', 'RequireAdmin } } +function FinalCleanUp +{ + if(Test-Path $TempDir) + { + Remove-Item -Path $TempDir -Recurse -Force + } +} + Describe "PSResourceGet - ACR tests" -tags "Feature" { BeforeAll { @@ -396,12 +404,3 @@ Describe "PSResourceGet - ACR tests" -tags "Feature" { FinalCleanUp } } - - -function FinalCleanUp -{ - if(Test-Path $TempDir) - { - Remove-Item -Path $TempDir -Recurse -Force - } -}