Default WebServiceEndpoint value for SMA Cmdlets

  • 0

Default WebServiceEndpoint value for SMA Cmdlets

When using the Cmdlets of the Service Management Automation (SMA) PowerShell module, all actions are targeted against a SMA Web Service and therefore have a required parameter called WebServiceEndpoint. If you’re kinda stressed out by repetitively typing this parameter value, you can define a default parameter value in your Windows PowerShell session to set the value automatically. For example, in your PowerShell profile script, use the following command to set the default value for the WebServiceEndpoint parameter for all related SMA Cmdlets:

Refer to “about_Parameters_Default_Values” in order to get more information about the $PSDefaultParameterValues built-in variable.

Hope this helps


  • 2

grep for PowerShell

Hello again. This time I will share a small function that resides in my PowerShell profile script: grep. What is grep? grep is a text search utility originally written for Unix. The command name is an abbreviation for “global regular expression print”. The original grep – and my PowerShell grep function as well – searches files for lines matching a given regular expression and displays the matches in standard output.

Here comes the ready for use function…

Actually the grep function simplifies the usage of a command line like below:

Using grep you just need to type this:

Ah, almost I forgot to mention that the Select-String cmdlet is PowerShell’s grep.