About 700,000 results
Open links in new tab
  1. How can I pass an argument to a PowerShell script?

    In my particular use-case, I wanted to access the arguments from the profile which ignored the params, and simply checked for the existence of an argument (essentially a switch).

  2. How to handle command-line arguments in PowerShell

    passing parameters from command line to powershell. 1. passing parameters to script from powershell.exe. 4.

  3. How to define named parameter as [ref] in PowerShell

    Feb 8, 2016 · I felt I needed to write this complementary very simplistic answer since this was the first google hit when searching for info on using reference parameters in Powershell functions. …

  4. How do I pass multiple parameters into a function in PowerShell?

    For further reading, see my article Down the Rabbit Hole: A Study in PowerShell Pipelines, Functions, and Parameters. The article contains a link to the quick reference/wall chart as well. …

  5. How to pass command-line arguments to a PowerShell ps1 file

    Aug 18, 2009 · File must be the last parameter in the command, because all characters typed after the File parameter name are interpreted as the script file path followed by the script …

  6. function - Conditional PowerShell parameters - Stack Overflow

    Jun 5, 2019 · A typical example would be to create a different set of dynamic parameters depending on the value of a regular parameter, by using a simple if in the DynamicParam …

  7. powershell - Passing null to a mandatory parameter to a function ...

    Aug 23, 2014 · You should be able to use the [AllowEmptyString()] parameter attribute for [string] parameters and/or the [AllowNull()] parameter attribute for other types. I've added the …

  8. Pass Powershell parameters within Task Scheduler

    Jun 16, 2017 · I recommend scheduling the task to use the -File parameter rather than -Command.Example: Program/script: …

  9. PowerShell guidelines for -Confirm, -Force, and -WhatIf

    Are there any official guidelines from Microsoft about when to add -Confirm, -Force, and -WhatIf parameters to custom PowerShell cmdlets? There doesn't seem to be a clear consensus …

  10. How do I make parameters mandatory in PowerShell?

    Aug 23, 2011 · When you call a PowerShell script without providing the mandatory parameters the script prompts you for them interactively before executing, e.g. "Supply values for the …