Putting CSV Data as is into a New CSV

PowerShell
I have a CSV file with two columns; Identitiy, and User. the User column contains UserPrincipalNames, and the Identity column contains a name. What I'...
2 years ago

How to unzip a file in Powershell?

PowerShell
I have a .zip file and need to unpack its entire content using Powershell. I'm doing this but it doesn't seem to work: $shell = New-Object -ComObject...
2 years ago

Can I use a single quote in a Powershell 'string'?

PowerShell
I want to include an apostrophe in my string. Is it possible to do without using double quotes? 'This is a quote. Can`'t I just include a single quot...
2 years ago

Powershell EMail: How to add new line in email Body?

Powershell
Very new to Powershell. Wrote powershell script which is working perfectly but when it sends mail it does not show new line character in body. Followi...
2 years ago

converto-html breaks the table, tried with PSobject as input

Powershell
I get a strange output with Converto-HTML on Azure function for the following: I am trying to build a HTML and pipe it to Converto-HTML and send email...
2 years ago

Exclude list in PowerShell Copy-Item does not appear to be working

Powershell
I have the following snippet of PowerShell script: $source = 'd:\t1\*' $dest = 'd:\t2' $exclude = @('*.pdb','*.config') Copy-Item $source $dest -Recu...
2 years ago

New-SPWebApplication application pool account is not found

Powershell
I am trying to create a new web application using PowerShell. I keep getting the error application pool account is not found! How do I solve this? I ...
2 years ago

Powershell convert string to datetime

Powershell
I am using powershell to try and convert a string to a datetime. Should be easy right? I am getting the string from a csv import and it comes in in ...
2 years ago

loop for txt split file

Powershell
I am trying to make this following query loop through and split all the text files in the current directory. I currently have two different files name...
2 years ago

Limit csv column length using PowerShell

PowerShell
I'm trying to adjust a tab-delimited textfile without headers using PowerShell and have it write the output to the same tab-delimited textfile. Curren...
2 years ago

Creating a Powershell menu from from config file

PowerShell
I have been trying to build a menu from a config file in Powershell. The purpose of the menu is to call other scripts and executables and to make mai...
2 years ago

how i can start process with large multiline script block in powershell?

PowerShell
i wanna start process powershell with script block . like this code. start-process powershell.exe -ArgumentList "-noexit","-command { set-Set-Execut...
2 years ago

Powershell long text Indentation/padding

PowerShell
I'm trying to indent a long string in a write-host. While it trivial to .PadLeft() or prepend spaces in writing a short string, the same isn't true fo...
2 years ago

PS get-content high memory usage - Is there a more efficient way to filter a file?

PowerShell
I am using get-content to read a largish file (252 MB), but when I use get-content to read it, the powershell process proceeds to consume almost 10 GB...
2 years ago

Installing JRE using Powershell DSC hangs

PowerShell
I'm trying to remote install Java Runtime (8 as it happens) using Powershell DSC on a Windows 2012 R2 box, but it appears to be hanging. I initiall...
2 years ago

Recursive directory listing with 8.3 shortname notation

PowerShell
I have a PS command: PowerShell.exe "dir -Verbose -Recurse | Select-Object Mode, Length, Name, Directory | Export-Csv "listing.csv"" This works to ...
2 years ago

Error quoting and/or escaping, cmd running Powershell

PowerShell
I am missing something when I try to convert the following single line command into multiple lines. I searched, found, and tried to model this change ...
2 years ago

Sort and export-CSV

PowerShell
I have a csv file containing rows of the following extract: "EmployeeID","FirstName","LastName","Location","Department","TelephoneNo","Email" "0...
2 years ago

Setting playback device by executing a batch file / powershell script

PowerShell
I've got my computer(Windows 7) hooked up to the TV, and i very often change output device for sound between Digital Audio (S/PDIF)(High definition au...
2 years ago

Write output of a java program fired from Powershell to standard output

PowerShell
I have a powershell script that is calling a jar via the following code: Start-Process java -ArgumentList '-jar', "$jarPath", "$csvPath" However, t...
2 years ago