Command-line parameters that include space(s) must be surrounded by double-quotes: winscp.exe /ini ="C:\Users\martin\Documents\myconfig.ini" To use the double-quote as a literal, use two double-quotes sequentially. (An interesting side note: if you do put a space after comma, it will still treat the list of drive letters as a single parameter, the comma basically eats the space.). Parameters can be passed by position or by name. SQL Prompt is an add-in for SQL Server Management Studio (SSMS) and Visual Studio that strips away the repetition of coding. As well as offering advanced IntelliSense-style code completion, full formatting options, object renaming, and other productivity features, SQL Prompt also offers fast and comprehensive code analysis as you type. powershell -Command {Get-WinEvent -LogName security} In cmd.exe , there is no such thing as a script block (or ScriptBlock type), so the value passed to Command will always be a string. You must also be ingesting logs with both Instead, it builds a command-line string itself and assigns it to the System.Diagnostics.ProcessStartInfo.Arguments property, which is a single string; the .ArgumentList property didn't become available until .NET Core 2.1. (If you don't know about PowerShell, please see the tip, "Introduction to PowerShell".) Type in the same command as above but add a dash (-) at the end. The method works, but I would argue that it’s not ideal. I am using a program called sonar-runner that you execute from the commandline, and you can pass optional parameters. There may also be cases where you don’t want a default parameter, but you absolutely want to make sure a value is entered. Per forum request, this article provides examples of how to access the packager's command line arguments as well as provide some useful functions to parse the contents. If the program does not use the MS C/C++ runtime parser to parse command line arguments, then how it is parsed is entirely This may be a problem if you need to control the type of data the user is entering. Command Line Parameters in Powershell. Summary: Microsoft Scripting Guy, Ed Wilson, talks about using named arguments in Windows PowerShell functions. If you want to be a bit more explicit in what you’re doing, you can also pass the values in as an array: Note that in this case, you do have to qualify the drive letters as strings by using quotes around them. This command-line string building is PowerShell should now pop up a little dropdown that shows you the available parameters. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Use a normal command line (cmd) interface to run the command without the powershell bits. Using --%, so PowerShell will treat the rest of the command line as arguments to the application. PowerShell Python command-line arguments Tagged: powershell, python This topic has 1 reply, 2 voices, and was last updated 2 weeks, 1 day ago by David Figueroa. In this article, Greg Moore explains how to write a PowerShell script that takes parameters. In PowerShell the command line arguments are the variable names used within the param () block. @(10, 100, 1000, 10000, 100000) | ForEach-Object { $IterationTime = Measure-Command { $array = @() #make a fresh array 1..$_ | ForEach-Object { #We make Powershell count from 1 to the current value in the iteration 10, 100, 1000 Powershell pass parameters to ps1 file How to pass command-line arguments to a PowerShell ps1 file , This article helps. Hopefully, this article has given you some insight into the two methods of passing in variables to PowerShell scripts. Some options you can set are tab and pane arrangements as well as their starting directories and profiles. It was a simple request, and I supplied a simple solution. While his focus is on the operations side of DBA, his interests include DR, performance and general IT problem solving. The answer is simple; you can wrap the parameter in quotes: With the flexibility of PowerShell and quoting, you can do something like: If you experiment with entering different values into the scripts above, you’ll notice that it doesn’t care if you type in a string or a number or pretty much anything you want. You can do this by testing to see if the parameter is null and then prompting the user for input. wt new-tab "cmd" `; split-pane -p "Windows PowerShell" `; split-pane -H wsl.exe wt --% new-tab cmd ; split-pane -p "Windows PowerShell" ; split-pane -H wsl.exe If you do force the same parameter name twice, PowerShell will give you an error similar to: One question that probably comes to mind at this point is how you would handle a parameter with a space in it.