@@ -109,11 +109,15 @@ function Get-ImportKeyFile1024([string]$filesuffix, [bool] $exists=$true)
109
109
110
110
<#
111
111
. SYNOPSIS
112
- Remove log file under a folder
112
+ Remove log files under the given folder.
113
113
#>
114
- function Cleanup-Log ([string ]$rootfolder )
115
- {
116
- Get-ChildItem –Path $rootfolder - Include * .debug_log - Recurse | where {$_.mode -match " a" } | Remove-Item - Force
114
+ function Cleanup-LogFiles ([string ]$rootfolder )
115
+ {
116
+ Write-Host " Cleaning up log files from $rootfolder ..."
117
+
118
+ Get-ChildItem –Path $rootfolder - Include * .debug_log - Recurse |
119
+ where {$_.mode -match " a" } |
120
+ Remove-Item - Force
117
121
}
118
122
119
123
<#
@@ -125,7 +129,7 @@ function Move-Log([string]$rootfolder)
125
129
$logfolder = Join-Path $rootfolder (" $global :testEnv " + " $global :testns " + " log" )
126
130
if (Test-Path $logfolder )
127
131
{
128
- Cleanup- Log $logfolder
132
+ Cleanup- LogFiles $logfolder
129
133
}
130
134
else
131
135
{
@@ -138,24 +142,32 @@ function Move-Log([string]$rootfolder)
138
142
139
143
<#
140
144
. SYNOPSIS
141
- Removes all keys starting with the prefix
145
+ Remove all old keys starting with the given prefix.
142
146
#>
143
- function Initialize-KeyTest
147
+ function Cleanup-OldKeys
144
148
{
149
+ Write-Host " Cleaning up old keys..."
150
+
145
151
$keyVault = Get-KeyVault
146
152
$keyPattern = Get-KeyName ' *'
147
- Get-AzureKeyVaultKey $keyVault | Where-Object {$_.KeyName -like $keyPattern } | Remove-AzureKeyVaultKey - Force - Confirm:$false
153
+ Get-AzureKeyVaultKey $keyVault |
154
+ Where-Object {$_.KeyName -like $keyPattern } |
155
+ Remove-AzureKeyVaultKey - Force - Confirm:$false
148
156
}
149
157
150
158
<#
151
159
. SYNOPSIS
152
- Removes all secrets starting with the prefix
160
+ Remove all old secrets starting with the given prefix.
153
161
#>
154
- function Initialize-SecretTest
162
+ function Cleanup-OldSecrets
155
163
{
164
+ Write-Host " Cleaning up old secrets..."
165
+
156
166
$keyVault = Get-KeyVault
157
167
$secretPattern = Get-SecretName ' *'
158
- Get-AzureKeyVaultSecret $keyVault | Where-Object {$_.SecretName -like $secretPattern } | Remove-AzureKeyVaultSecret - Force - Confirm:$false
168
+ Get-AzureKeyVaultSecret $keyVault |
169
+ Where-Object {$_.SecretName -like $secretPattern } |
170
+ Remove-AzureKeyVaultSecret - Force - Confirm:$false
159
171
}
160
172
161
173
0 commit comments