Code

Listing 64-bit registry keys using a 32-bit process

I created a tool with PowerShell Studio but I had to create it as a 32-bit executable. But when you try to listing the 64-bit registry, you have to use this (working with Powershell V3 and up only) :


$AddRemoveBranch = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$ComputerName, [Microsoft.Win32.RegistryView]::Registry64)
$AddRemoveKey = $reg.OpenSubKey($AddRemoveBranch)
$AddRemoveKey.GetSubKeyNames() | ForEach-Object {write-host "Application : $_"}

Selected item in a DataGridView

Selected item in a DataGridView

This code will allow you to get the selected item in a DataGridView. In Powershell Studio, make sure to set the ColumnType as DataGridViewCheckBoxColumn


for($i=0;$i -lt $DataGridView1.RowCount;$i++){

if($DataGridView1.Rows[$i].Cells['Checked'].Value -eq $true){
write-host "Row $i is checked"
}
}