You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get-SafeguardMyRequest returns 1 "object" with all requests instead of one object for each request. Using Where-Object to filter results doesn't work... or at least not as one would expect.
Module version 7.4.126553
$ Get-SafeguardMyRequest
AccessRequestType : Password
AccountId : 1
AccountName : account1
AccountDomainName : mydomain.com
AssetId : 1
AssetName : mydomain
AssetNetworkAddress :
Id :
IsEmergency : False
State : PasswordCheckedOut
TicketNumber :
AccessRequestType : Password
AccountId : 2
AccountName : account2
AccountDomainName : mydomain.com
AssetId : 1
AssetName : mydomain
AssetNetworkAddress :
Id :
IsEmergency : False
State : PasswordCheckedOut
TicketNumber :
# Expect count here to be 2
$ Get-SafeguardMyRequest | measure
Count : 1
Average :
Sum :
Maximum :
Minimum :
StandardDeviation :
Property :
# Using where returns the all requests when the condition is met
$ Get-SafeguardMyRequest | where {$_.accountname -eq 'account1'}
AccessRequestType : Password
AccountId : 1
AccountName : account1
AccountDomainName : mydomain.com
AssetId : 1
AssetName : mydomain
AssetNetworkAddress :
Id :
IsEmergency : False
State : PasswordCheckedOut
TicketNumber :
AccessRequestType : Password
AccountId : 2
AccountName : account2
AccountDomainName : mydomain.com
AssetId : 1
AssetName : mydomain
AssetNetworkAddress :
Id :
IsEmergency : False
State : PasswordCheckedOut
TicketNumber :
# PS seems willing to treat it as a collection with some help?
$ Get-SafeguardMyRequest |%{ $_ | where {$_.accountname -eq 'account1'}}
AccessRequestType : Password
AccountId : 1
AccountName : account1
AccountDomainName : mydomain.com
AssetId : 1
AssetName : mydomain
AssetNetworkAddress :
Id :
IsEmergency : False
State : PasswordCheckedOut
TicketNumber :
The text was updated successfully, but these errors were encountered:
@azirish1998 Thank you for contacting us. Apologies for the delayed response.
When invoking Get-SafeguardMyRequest if you enclose the call in parentheses or assign the output to a variable it will give you the results you expect. This likely has to do with how the output from the API call is being interpreted by PowerShell, but I'm not 100% sure of all the mechanisms involved.
Get-SafeguardMyRequest returns 1 "object" with all requests instead of one object for each request. Using Where-Object to filter results doesn't work... or at least not as one would expect.
Module version 7.4.126553
The text was updated successfully, but these errors were encountered: