This commit is contained in:
Sykes
2025-04-22 17:48:46 -04:00
parent a7f9f1799f
commit fa185130ff
3 changed files with 159 additions and 8 deletions

View File

@@ -15,12 +15,12 @@ function New-PPTAuth {
process {
$isAuth = $false
& $Global:pptConfig.pacPath auth create --cloud UsGovDod --deviceCode | ForEach-Object {
& $Global:pptConfig.pacPath auth create --cloud UsGov --deviceCode | ForEach-Object {
if ($_ -match 'To sign in, use a web browser to open the page') {
Write-Host "[ Info ] " -ForegroundColor Green -nonewline
Write-host "$_" -ForegroundColor Cyan
Set-Clipboard -Value "$(($_ -split "To sign in, use a web browser to open the page | and enter the code | to authenticate.")[2])"
Start-Process microsoft-edge:https://microsoft.com/deviceloginus -OutVariable procout
Start-Process microsoft-edge:https://microsoft.com/devicelogin -OutVariable procout
} else {
if ($_ -match 'authenticated successfully') {
$isAuth = $true