Skip to content

Commit

Permalink
remove profile switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jazuntee committed Jan 28, 2023
1 parent 69a719c commit 45588c3
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Get-MsIdUnredeemedInvitedUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ function Get-MsIdUnredeemedInvitedUser {
## Initialize Critical Dependencies
$CriticalError = $null
if (!(Test-MgCommandPrerequisites 'Get-MgUser' -MinimumVersion 1.10.0 -RequireListPermissions -ErrorVariable CriticalError)) { return }

## Save Current MgProfile to Restore at End
$previousMgProfile = Get-MgProfile
if ($previousMgProfile.Name -ne 'v1.0') {
Select-MgProfile -Name 'v1.0'
}

}

process {
Expand Down Expand Up @@ -106,13 +99,4 @@ function Get-MsIdUnredeemedInvitedUser {
}

}

end {
if ($CriticalError) { return }

## Restore Previous MgProfile
if ($previousMgProfile -and $previousMgProfile.Name -ne (Get-MgProfile).Name) {
Select-MgProfile -Name $previousMgProfile.Name
}
}
}

0 comments on commit 45588c3

Please sign in to comment.