Extract Icon from .EXE Powershell
Function ExtractIcon {
Param (
[Parameter(Mandatory=$true)]
[string]$folder
)
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-N...
Function ExtractIcon {
Param (
[Parameter(Mandatory=$true)]
[string]$folder
)
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null
md $folder -ea 0 | Out-Null
dir $folder *.exe -ea 0 -rec |
ForEach-Object {
$baseName = [System.IO.Path]::GetFileNameWithoutExtension($_.FullName)
Write-Progress "Extracting Icon" $baseName
[System.Drawing.Icon]::ExtractAssociatedIcon($_.FullName).ToBitmap().Save("$folder\$BaseName.ico")
}
}
ExtractIcon -folder "C:\Path"
Optimizing your $Profile
Optimizing your $Profile Your PowerShell Profile allows you to customize your PowerShell session and runs at startup. Complex profiles can cause a significant delay in the startup of PowerShell as it is a script that needs to be executed before the prompt first shows up.
Use a PowerShell Module to Run Windows Update | Scripting Blog
Summary: Microsoft Scripting Guy, Ed Wilson, talks about using a free Windows PowerShell module to run Windows Update on a computer. Microsoft Scripting Guy, Ed Wilson, is here. One thing that is a bit disappointing is that Windows 8 and Windows Server 2012 do not come with cmdlets to permit me to run Windows Update from inside Windows PowerShell.