Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-TppAttribute gives error when using $null as value #176

Closed
wilddev65 opened this issue Dec 9, 2022 · 1 comment
Closed

Set-TppAttribute gives error when using $null as value #176

wilddev65 opened this issue Dec 9, 2022 · 1 comment

Comments

@wilddev65
Copy link
Collaborator

When trying to clear an attribute set on a policy, Set-TppAttribute gives an error if null is used as the attribute value;

$Attributes = @{
    'Script Execution Timeout' = $null
}

$Path | Set-TppAttribute -PolicyClass 'Adaptable App' -Attribute $Attributes

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\VenafiPS\5.2.1\Public\Set-TppAttribute.ps1:136 char:13

  •         $thisValue = ($_.Value).ToString()
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull
wilddev65 added a commit that referenced this issue Dec 9, 2022
…is empty (part of 170)

Invoke-VenafiCertificateAction always run as verbose (#173)
Set-TppAttribute gives error when using $null as value (#176)
@wilddev65
Copy link
Collaborator Author

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant