About 891,000 results
Open links in new tab
  1. Powershell class implement get set property - Stack Overflow

    Apr 7, 2022 · How can I implement a get/set property with PowerShell class? Please have a look on my example below: [DateTime]$StartTimestamp = (Get-Date) [DateTime]$EndTimestamp …

  2. about_Parameter_Sets - PowerShell | Microsoft Learn

    For parameters that belong to multiple parameter sets, add a Parameter attribute for each parameter set. The Parameter attribute enables you to define the parameter differently for …

  3. Sample scripts for system administration - PowerShell

    A collection of examples walks through scenarios for administering systems with PowerShell. NOTE: Most of these examples only work on Windows.

  4. How To Use Parameter Sets With Examples In PowerShell Functions

    Parameter Sets in PowerShell functions enable the possibility to get the results of the function using different input parameter groups according to the needs. Previous sentence sounds like …

  5. PowerShell Script Examples [Top 75] - SPGuides

    Jan 18, 2024 · Get-Command List all cmdlets, functions, scripts, and aliases in your session. It’s useful for discovering the commands you can use for various tasks. 4. Setting Execution …

  6. Set (data structure) in PowerShell - Stack Overflow

    Mar 18, 2015 · At least with powershell core $set.Add("foo", $true) throws an exception if the key already exists. Therefore $set["foo"] = $true should be used instead, as it not only allows …

  7. How to Write Awesome Functions with PowerShell Parameter Sets

    Feb 3, 2021 · In this post, I will show you how to add parameter sets to your PowerShell functions. I will also demonstrate how to tell which parameter set is being used in the function. You can …

  8. powershell - How does $_ get set in a ScriptBlock? - Stack Overflow

    Jan 27, 2023 · Using the .Invoke() method (and its variants, .InvokeReturnAsIs() and .InvokeWithContext()) to execute a script block in PowerShell code is best avoided, because it …

  9. 5 PowerShell Script Examples To Inspire You to Get Scripting

    Jul 28, 2021 · To make changes to the registry, listed below are three different PowerShell commands. Let’s cover some examples of how each of these PowerShell cmdlets works. New …

  10. Adding Multiple Parameter Sets to a PowerShell Function

    Feb 22, 2018 · Sometimes you need to add more than one parameter set to a function you're creating. If that's not something you're familiar with, it can be a little confusing at first. In the …

Refresh