VS Code flags Venafi function names with warnings -FIX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VS Code flags Venafi function names with warnings -FIX

L0 Member
Just sharing something that has bugged me for a while.If you use VS Code to write your PowerShell drivers, then you have likely run into this issue. The built-in script analyzer highlights lots of really useful issues and has improved my code a lot, but it flags the Venafi required function name Perform-Action as a problem. Now theres nothing I can do about the Venafi implementation using the unapproved verb Perform but now all my adaptable log drivers are flagged with problems.The cmdlet Perform-Action uses an unapproved verb.If it was my code I would change the function name, but here my hands are tied.After much searching and researching, I found the way to disable just this warning without completely disabling this or other Script Analyzer functionality for my code. Inserting this line inside the function but before the Param( block will suppress this warning/problem.[Diagnostics.CodeAnalysis.SuppressMessage("PSUseApprovedVerbs", Scope="function", Target="Perform-Action" )]No more warnings / problems in my Adaptable Log driver..!I have updated my template with this so all my future drivers will not suffer from this issue and Im working through my handful of existing drivers as well.Venafi Team: It might be nice to include something like this line in the examples distributed with the product..
0 REPLIES 0
  • 52 Views
  • 0 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!