PowerShellComponent

Hi Team,

Need some help with respect to PowerShellComponent

I have a requirement to return the TemporaryAccessPass by executing the below PowerShell and send it over mail.

Is it possible to get the output of PowerShell(need to get TemporaryAccessPass) and store it in a variable using PowerShellComponent ?

Please share sample script if you have any.

# Create a Temporary Access Pass for a user $properties = @{} $properties.isUsableOnce = $True $properties.startDateTime = '2022-05-23 06:00:00' $propertiesJSON = $properties | ConvertTo-Json New-MgUserAuthenticationTemporaryAccessPassMethod -UserId user2@contoso.com -BodyParameter $propertiesJSON Id CreatedDateTime IsUsable IsUsableOnce LifetimeInMinutes MethodUsabilityReason StartDateTime TemporaryAccessPass -- --------------- -------- ------------ ----------------- --------------------- ------------- ------------------- 00aa00aa-bb11-cc22-dd33-44ee44ee44ee 5/22/2022 11:19:17 PM False True 60 NotYetValid 23/05/2022 6:00:00 AM TAPRocks!

Parents Reply Children
No Data