fix: Fix SPO output for Get-SPOSite

This commit is contained in:
DrIOS
2025-01-14 13:07:59 -06:00
parent a8b76c7e16
commit 642cdfe2ab
3 changed files with 10 additions and 3 deletions

View File

@@ -79,7 +79,8 @@ function Connect-M365Suite {
(Get-PnPSite).Url
}
else {
$sites = Get-SPOSite
# Supress output from Get-SPOSite for powerautomate to avoid errors
[void]($sites = Get-SPOSite -Limit All)
# Get the URL from the first site collection
$url = $sites[0].Url
# Use regex to extract the base URL up to the .com portion