Prompt for user input in PowerShell
I want to prompt the user for a series of inputs, including a password and a filename. I have an example of using … Read more
I want to prompt the user for a series of inputs, including a password and a filename. I have an example of using … Read more
I’m attempting to POST to a uri, and send the parameter username=me Invoke-WebRequest -Uri http://example.com/foobar -Method POST How do I pass the parameters … Read more
I run this code to execute PowerShell code from an ASP.NET application: System.Management.Automation.Runspaces.Runspace runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(); runspace.Open(); System.Management.Automation.Runspaces.Pipeline pipeline = runspace.CreatePipeline(); pipeline.Commands.AddScript(@”\\servername\path”); pipeline.Commands.Add(“Out-String”); … Read more
I am updating a PowerShell script that manages some .NET assemblies. The script was written for assemblies built against .NET 2 (the same … Read more
This should be a simple task, but I have seen several attempts on how to get the path to the directory where the … Read more
I am running a PowerShell script from within a batch file. The script fetches a web page and checks whether the page’s content … Read more
I am trying to run this script in PowerShell. I have saved the below script as ps.ps1 on my desktop. $query = “SELECT … Read more
I have a PowerShell script for which I would like to redirect the output to a file. The problem is that I cannot … Read more
I have a PowerShell 1.0 script to just open a bunch of applications. The first is a virtual machine and the others are … Read more
I want to create an alias of a cmdlet that doesn’t expire after I close the current session of Powershell, let’s say I … Read more