From 6a36255b29d0b778648540276423af581ad47079 Mon Sep 17 00:00:00 2001 From: Keepers Date: Mon, 10 Apr 2023 16:41:38 -0600 Subject: [PATCH] split in pwsh, not gh action (#3065) Couldn't figure out why the inputs in my local purges weren't working. It's because we split the input in gh, not in powershell. --- src/cmd/purge/scripts/exchangePurge.ps1 | 4 ++++ src/cmd/purge/scripts/onedrivePurge.ps1 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/cmd/purge/scripts/exchangePurge.ps1 b/src/cmd/purge/scripts/exchangePurge.ps1 index 7ba036522..240364b8d 100644 --- a/src/cmd/purge/scripts/exchangePurge.ps1 +++ b/src/cmd/purge/scripts/exchangePurge.ps1 @@ -618,6 +618,10 @@ function Purge-Items { Write-Host 'Authenticating with Exchange Web Services ...' $global:Token = Get-AccessToken | ConvertTo-SecureString -AsPlainText -Force +# ensure that there are no unexpanded entries in the list of parameters +$FolderNamePurgeList = $FolderNamePurgeList | ForEach-Object { @($_.Split(',').Trim()) } +$FolderPrefixPurgeList = $FolderPrefixPurgeList | ForEach-Object { @($_.Split(',').Trim()) } + $purgeFolderParams = @{ 'WellKnownRoot' = "root"; 'FolderNamePurgeList' = $FolderNamePurgeList; diff --git a/src/cmd/purge/scripts/onedrivePurge.ps1 b/src/cmd/purge/scripts/onedrivePurge.ps1 index 641445c1f..dbb31c1e8 100644 --- a/src/cmd/purge/scripts/onedrivePurge.ps1 +++ b/src/cmd/purge/scripts/onedrivePurge.ps1 @@ -112,6 +112,10 @@ function Purge-Library { ######## MAIN ######### +# ensure that there are no unexpanded entries in the list of parameters +$LibraryNameList = $LibraryNameList | ForEach-Object { @($_.Split(',').Trim()) } +$FolderPrefixPurgeList = $FolderPrefixPurgeList | ForEach-Object { @($_.Split(',').Trim()) } + # Setup SharePointPnP if (-not (Get-Module -ListAvailable -Name PnP.PowerShell)) { $ProgressPreference = 'SilentlyContinue'