How do I pass DateTime as a parameter in PowerShell??

I have a script that's calling another script and passing in parameters along with it. Whenever I try to pass in a d...

Add rows to CSV File in powershell?

Trying to figure out how to add a row to a csv file with titles. I get the content using: $fileContent = Import-csv...

How to convert string to integer in PowerShell?

I have a list of directories with numbers. I have to find the highest number and and increment it by 1 and create a ...

Create directory if it does not exist?

I am writing a PowerShell script to create several directories if they do not exist. The filesystem looks similar t...

Running PowerShell as another user, and launching a script?

I won't get into all the details of why I need this, but users must be able to launch PowerShell as a service accoun...

Creating Zip files using PowerShell?

I have these below files at a location C:\Desktop\Mobile. Apple_iphone6.dat Apple_iphone7.dat Samsung_e...

How to pass needed parameters to script in Powershell ISE??

See Title. I specified needed parameters in the head of a script: param ($G_ARCHIVE = $(throw "Need file to upload...

Finding modified date of a file/folder?

I am very new to PowerShell, and I was hoping I could get some help creating a script that tells me the modified dat...

Spaces cause split in path with PowerShell?

I'm having an issue with powershell when invoking an exe at a path containing spaces. PS C:\Windows Services> in...

Script for clearing Chrome or Firefox cache on Windows?

With Internet Explorer you can create a .bat file to clear the cache. Example: RunDll32.exe InetCpl.cpl,ClearMyTra...

PowerShell Create Folder on Remote Server?

The following script does not add a folder to my remote server. Instead it places the folder on My machine! Why do...

PowerShell display files size as KB, MB, or GB?

I have a section of a PowerShell script that gets the file size of a specified directory. I am able to get the valu...

Upload file to SFTP using PowerShell?

We were asked to set up an automated upload from one of our servers to an SFTP site. There will be a file that is ex...

How do I concatenate two text files in PowerShell??

I am trying to replicate the functionality of the cat command in Unix. I would like to avoid solutions where I expl...