refactor: Remove hardcoded -SiteUrl parameter from SharePoint functions

This commit is contained in:
Bobby Abellana (aider) 2025-02-19 15:19:36 -08:00
parent a5ba06c2bf
commit 87da4e1185

View File

@ -111,8 +111,7 @@ function List-XlsFiles {
} }
function Convert-Files { function Convert-Files {
if (-not (Connect-SharePoint -SiteUrl "https://yoursite.sharepoint.com")) { if (-not (Connect-SharePoint)) {
return
} }
$excel = New-Object -ComObject Excel.Application $excel = New-Object -ComObject Excel.Application
@ -141,8 +140,7 @@ function Convert-Files {
} }
function Move-Files { function Move-Files {
if (-not (Connect-SharePoint -SiteUrl "https://yoursite.sharepoint.com")) { if (-not (Connect-SharePoint)) {
return
} }
$files = Get-Content "$env:TEMP\FileList.json" | ConvertFrom-Json $files = Get-Content "$env:TEMP\FileList.json" | ConvertFrom-Json