$emailAddress='[email protected]'
$field='accounts:last_login_time'
function getGamUser{
param(
$emailAddress,
$field
)
$result=try{gam report users user $emailAddress}catch{}
if($result){
$headers=$result[0] -split ','
$index=$headers.IndexOf($field)
return ($result[1] -split ',')[$index]
}else{
write-warning "$emailAddress field $field has not matched anything"
return $null
}
}
getGamUser $emailAddress $field
July 15, 2021July 15, 2021
0 Comments