Advertisement
Combreal

New-FWFunctionSnippet.ps1

Apr 27th, 2021
1,251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $M = @'
  2. Function Verb-FWNomn([Parameter(Mandatory=$True)][String]$ClientName, [switch]$Production)
  3. {
  4.     <#
  5.     .SYNOPSIS
  6.    
  7.     #>
  8.  
  9.     If ($Production)
  10.     {
  11.         $Global:FilewaveToken = $Global:ProdFilewaveToken
  12.         $Global:ServerAdress = $Global:ProdServerAdress
  13.     }
  14.     Else
  15.     {
  16.         $Global:FilewaveToken = $Global:QualifFilewaveToken
  17.         $Global:ServerAdress = $Global:QualifServerAdress
  18.     }
  19.  
  20.     $Query = New-FWQuery "VERB" "QUERY" "ARG"
  21.     If(!$Query)
  22.     {
  23.         Write-Host "Something went wrong."
  24.     }
  25.    Else
  26.    {  
  27.        Return $Query
  28.    }
  29. }
  30. '@
  31.  
  32. New-ISESnippet -Text $M -Title FWFunction -Description "Adds a new Filewave function." -Force
  33. #triggers with Control+j in powershellISE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement