Sorting according to version numbers in PowerShell

PowerShell
I am sorting the folders in a directory according to version numbers and removing the old ones. The problem I am having is thanks to octopus deploy's...
2 years ago

Sorting using the sort object in PowerShell part 2

PowerShell
I am still stuck trying to sort and remove duplicates from a CSV file (separated by commas) containing some data into a new CSV file dynamically. Got ...
2 years ago

How to turn array into multiple rows?

PowerShell
I'm using Powershell to show all Group Policies and what they are linked to. This requires the GroupPolicy module (Import-Module GroupPolicy) and the ...
2 years ago

Verify Passwords Match in Windows Powershell

PowerShell
I'm creating a script to handle unattended domain joining for the school district I work at. We have several IT guys who handle sysprep, so I'm creat...
2 years ago

How to do something if a job has finished

PowerShell
I'm trying to implement a GUI to my PowerShell script to simplify a certain process for other users. I have following PowerShell script: if ($checkBo...
2 years ago

Internal Error Occurred When Creating RunSpace

PowerShell
I have an app which allows user's to update other user's out of office message on Exchange via a simple web interface. My initial attempt at creatin...
2 years ago

loop through subfolders

PowerShell
Hi I would like to create a batch file to get all the sub-folders.Can anyone please help me on this?
2 years ago

compare-object doesn't give any output

PowerShell
i run $serv1=gwmi -Namespace Root\cimv2 -Class Win32_service i stop some services manually and then run $serv2=gwmi -Namespace Root\cimv2 -Class W...
2 years ago

Select-String -Quiet not returning True

PowerShell
My script is supposed to get the TCP connection information for VNC and tell me when the connection state is ESTABLISHED. I'm stuck on trying to get a...
2 years ago

Get-Child Item for Only Files Contained in Array

PowerShell
I'm trying to limit the return of a gci to only items contained in an array. Let's say the folder below contains several files, all named File_A, File...
2 years ago

Run N parallel jobs in powershell

PowerShell
I have the following powershell script $list = invoke-sqlcmd 'exec getOneMillionRows' -Server... $list | % { GetData $_ > $_.txt ZipTheFil...
2 years ago

Powershell Function Parameters for filtering

PowerShell
I am trying to write a function which pulls all my servers from sql database. It works correctly. I need to implement filtering for each columns so I ...
2 years ago

-replace does not replace string with "()"

PowerShell
I'm trying to replace a string containing parentheses in PowerShell. However, when I try this to do this it is not working. Any idea as to where I'm...
2 years ago

Get a json value using powershell 2.0

PowerShell
I know this is super easy using powershell 3.0. Alas I am using v2 for now. So, say I have a json file (config.json) that looks like this: { "e...
2 years ago

Compare-object output in variable

PowerShell
I'm building a script that will compare the last octed of in-use IPv4 addreses, with all the available octeds (2 till 254). I am already this far tha...
2 years ago

how to compare two custom dates in powershell v2.0

PowerShell
Is it possible to compare 2 custom dates. Am trying check if variables hold date1 is lessthan date2, if so, report saying date1 is older date. I gett...
2 years ago

Powershell, Replace a character with new line

PowerShell
Powershell ver 4. Windows 7. Hello everyone. I wanted to replace ',' with new lines in a text file. I tried below script (Get-Content C:\Test\test....
2 years ago

Use a variable in a command

PowerShell
This is part of the PowerShell script I am working on: Write-Host $configJson.myVal (Get-Content .\config.js) -replace "S=''", "S='$configJson.myVal'...
2 years ago

Modify the array text condition in an Outlook rule with PowerShell?

PowerShell
I work on a team, who manage a few hundred servers. We each take primary responsibility for about 100 servers. I am the new person on the team, so I ...
2 years ago

Why single element hashtable behaves differently in powershell?

PowerShell
Code sample: function ToArray([hashtable] $hashTable){ $ret = @() foreach($key in $hashTable.Keys){ $ret += ("`"" + $key + ":" + $has...
2 years ago