Hey All,
I've got a powershell script I've been working on to automate user onboarding, and everything is working fine except for this part:
# --Begin Section that doesn't work--
$Work_Phone = Read-Host "Enter work phone number here (Format: (XXX) XXX-XXXX)"
while($Work_Phone -notmatch '^\(\d{3}\) \d{3}-\d{4}$')
{
$Work_Phone = Read-Host "Invalid phone number format. Please use (XXX) XXX-XXXX format." -ForegroundColor Red
}
# Add User's Phone Number
Write-Host "Adding work phone number for $email ..." -ForegroundColor Green
gam.exe update user $email phone type work value "$Work_Phone"
# --End Section that doesn't work--
for some reason GAM states that it has updated the user, but it doesn't update them. If I take this part of the script and put it into its own .ps1 file, it works without issue. Any ideas?