PowerShell renaming multiple files with upcounting variable

PowerShell
I have several files in my folder which look like this: PM.KDP_client_provide_123_SE.xml PM.KDP_client_provide_124_SE.xml PM.KDP_client_provide_125_S...
2 years ago

Overwriting specific Line in multiple Files using PowerShell with User Input

PowerShell
Im trying to get my PowerShell Script to read the specific line 8 on different .ctl files in multiple folders and overwrite it using a premade text an...
2 years ago

PS - Parameter's default value in Visual Studio 2015

PowerShell
I'm making a PowerShell script, and I've found something strange happening with my Visual Studio 2015. When I'm trying to assign value to sciript's pa...
2 years ago

How to get an object's property's value by property name in PowerShell?

PowerShell
In PowerShell, how do you get an object's property value by specifying its name (a string)? I want something like the following: $obj = get-something...
2 years ago

PowerShell Get-ChildItem how to catch Exception

PowerShell
Im currently programming a visual error GUI that catches any exception while processing and give's the user an "easy to understand" error message. But...
2 years ago

workingdirectory does not work when verb is used

PowerShell
Using Start-Process, when Verb is used, the Workingdirectory option does not work, the new powershell always start in C:\WINDOWS\system32. Why is this...
2 years ago

how to execute a script which reads an .ini file to execute a command from a text file

PowerShell
Basically I have a script, which is trying to read the content of a configuration file called commands.ini which redirects to a text file which contai...
2 years ago

script to make content entry into a text file

PowerShell
How to include some "text" into a .txt format file without opening the same via a script on windows?
2 years ago

Using Powershell and Test-Path, how can I tell the difference between a "folder doesn't exist" and "access denied"

PowerShell
Using the Test-Path command in powershell, how can I tell the difference between a "folder doesn't exist" and "access denied"?
2 years ago

Get PublishProfile for an Azure WebApp using Powershell

PowerShell
How can we get the PublishProfile for an Azure WebApp using Powershell? I'm not looking for Get-AzurePublishSettingsFile cmdlet. That gives me the Pu...
2 years ago

Does it matter where I put a trap{} in my PowerShell script

PowerShell
I have some PowerShell scripts with a load of initialization steps, at the end of which I put a trap{} statement, intending to catch all unhandled err...
2 years ago

How to define a function in a Powershell runspace and execute it

PowerShell
I'would like to define a function in a powershell and execute it in a different runspace. I tried this: Function Add-Message { param( [param...
2 years ago

How to run PowerShell scripts from C#

PowerShell
I am trying to run a PowerShell script with C#, but I don't have any success. Here is my function: private void ExecutePowerShellCommand(string scrip...
2 years ago

Filter Arabic Words Using PowerShell

PowerShell
We have some accounts in the Active Directory with an Arabic display name and we want to change it to English, but I don't know how to get these accou...
2 years ago

Powershell Remote Invoke-Command Start-Process App Immediately Closes After Launch

PowerShell
I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed...
2 years ago

How to run cmd as admin and run commands together

PowerShell
I'm looking for a way to be able to open a admin level cmd prompt and then execute a command in that same admin cmd all together in a batch file. I w...
2 years ago

How to read xml value via cmd / Powershell

PowerShell
I have the following xml format How can I read the value of Tar Path <?xml version="1.0" encoding="utf-8"?> <Foo xmlns:xsd="http://www.w3.o...
2 years ago

Powershell: Forcing evaluation of a block of code in Add-member's -value option

PowerShell
I'm trying to import users into an active directory using a CSV file and a powershell script. I create a CSV with the headers normally associated with...
2 years ago

System cannot find path/command not found error in Powershell

PowerShell
I have an installation of Elasticsearch that has worked fine for months but has inexplicably gone missing according to Powershell. The only thing I ca...
2 years ago

Powershell work with multiline text in Excel cell

PowerShell
I have a fairly simple request (for me it is quite tough task tbh). I have two CSV files which I want to convert to Excel so each of these two CSV fi...
2 years ago