From 1260d739e30ef780be97997eb0ffb97d8c13107d Mon Sep 17 00:00:00 2001 From: GreatScott000 <4333956+GreatScott000@users.noreply.github.com> Date: Wed, 24 Nov 2021 13:48:26 +0000 Subject: [PATCH] Correct bad file name for DownloadSymbol Had a third-party PTE that had a colon ":" in the app name, this caused an error with an invalid file name. I added some parsing of the $app.Name to remove bad file name characters. --- samples/PermissionSetConversion/Convert-PermissionSets.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/PermissionSetConversion/Convert-PermissionSets.psm1 b/samples/PermissionSetConversion/Convert-PermissionSets.psm1 index 72abd525..914fb26c 100644 --- a/samples/PermissionSetConversion/Convert-PermissionSets.psm1 +++ b/samples/PermissionSetConversion/Convert-PermissionSets.psm1 @@ -1,4 +1,4 @@ -Import-Module "sqlps" -DisableNameChecking +Import-Module "sqlps" -DisableNameChecking # The integer values of the types as specified # by the "Object Type" option field on the Permission table @@ -509,7 +509,7 @@ function Convert-PermissionSets foreach($App in $Apps) { - DownloadSymbolsFromDatabase -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -PackageId $App.ID -PackageSize $App.Size -Path (Join-Path $SymbolsFolder ($App.Name)) + DownloadSymbolsFromDatabase -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -PackageId $App.ID -PackageSize $App.Size -Path (Join-Path $SymbolsFolder ([string]::Join("_", $App.Name.Split([system.io.path]::GetInvalidFileNameChars(), [StringSplitOptions]::RemoveEmptyEntries)).TrimEnd('.'))) } $Symbols = ProccessSymbols $SymbolsFolder