Capture two digit pairs from a text

PowerShell
I want to capture all two digits from the following header file: #define KEYMAP( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0...
3 years ago

Get-Date inside Where or Where-Object

PowerShell
I have this $web = Get-SPWeb "http://sharepoint/mysubsite" $list=$web.Lists["Scanned Documents"] foreach ($item in $list.Items | where {$_.Indicator ...
3 years ago

Replacing Part of String at Position in Powershell

PowerShell
Right now i'm trying to convert my C# Code to an PowerShell Script. My actual function in C# looks like this: private static string ReplaceStringPar...
3 years ago

Append Member/Column to PSObject

PowerShell
I'm looking for a way to add an extra member to an object in PowerShell without creating a new object and looping. Typically when I run a script it ...
3 years ago

Automating cleanmgr.exe silently using PowerShell

PowerShell
I've been working on a script that is supposed to run cleanmgr.exe silently when disk C: is less than a 1gb, it's all working well, but one thing I co...
3 years ago

Automate batch file prompts with powershell

PowerShell
I have a batch file which prompts the user a few times. I am looking to automate that with powershell. Is there any way to do this? I would need somet...
3 years ago

Unable to load PowerShell Script Module

PowerShell
I am trying to load PowerShell Script Module. Below is the step I am following I have created 2 files under folder "C:\windows\system32\WindowsPowerS...
2 years ago

not getting output from receive job

PowerShell
The variable $var is blank when I run this script: function FOO { write-output "HEY" } $var = Start-Job -ScriptBlock { ${function:FOO} } | Wait-Job ...
2 years ago

Failed to get ComputerName in Powershell Get-Eventlog

PowerShell
In Security section in Event Viewer, there is a column named "Computer". I am using powershell to retrieve "all event ID 100" as of yesterday and dis...
2 years ago

Unable to pipe cmdlet objects in cmd

PowerShell
i am using this powershell command to fetch a particular user profile "Get-WmiObject -Class Win32_UserProfile | Where-Object {$_.LocalPath -eq 'C:\U...
3 years ago

.NET API for DirectAcces status

PowerShell
we are currently developing a .NET application that needs to know the Microsoft DirectAccess connection state. I know it is possible to query the stat...
3 years ago

How to search for a string and replace entire line using powershell? (If string NOT matched, need to create a new line with the content)

PowerShell
Sample.txt: SQL.test = True wer.vul = 1 temp_RTE = False user_admin = no In the above text file, I want to search for a string "test" and replace e...
3 years ago

PowerShell Script Loop - Alert New Files Created

PowerShell
I am hoping someone with PowerShell experience can ever so kindly advice (if it's possible) how we can loop this script. Unfortunately we are not too ...
3 years ago

Remove column name from PowerShell select-object results

PowerShell
Overall my goal is to get the VNC version for a list of remote computers along with the uninstall GUID so I can remotely uninstall VNC Viewer from cer...
2 years ago

Can't create a virtual environment in the Google Drive folder

PowerShell
I'm using Google Drive to keep a copy of my code projects in case my computer dies (I'm also using GitHub, but not on some private projects). However...
2 years ago

Read HKEY_USERS and HKEY_CURRENT_USERS

PowerShell
$strIPAddrTmp = "172.28.27.200" $strKeyIEConnections = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\" $strRegType = [Micro...
2 years ago

Powershell - Delete directory regardless of 260 char limit

PowerShell
I'm writing a simple script to delete USMT migration folders after a certain amount of days: ## Server List ## $servers = "Delorean","Adelaide","Bris...
3 years ago

Change some VM properties via PowerShell

PowerShell
I want to change some of my VM Properties according to a CSV. I have problem with Assigning memory to my VM. What is wrong in my code? The Error say...
3 years ago

Total number of labels inside a module of TFS repository

PowerShell
I need to find out how many labels are there inside each module of a collection in Team Foundation repository. I am using TFS 2013. I know we can get ...
3 years ago

How to invoke MSBuild from PowerShell using & operator?

PowerShell
I've just tested this on PowerShell v1.0. Setup is as follows: Id CommandLine -- ----------- 1 $msbuild = "C:\Windows\Microsoft.NET\Framework\v3....
3 years ago