The following Powershell code can be used to Extract an Icon from a file. The extracted icon will be saved with an ico file type.
$Source = "C:\Path\To\SourceFile.exe"
$Target = "C:\Path\To\Icon.ico"
Add-Type -AssemblyName System.Drawing
$Bitmap = [System.Drawing.Icon]::ExtractAssociatedIcon($Source).ToBitmap()
$Icon = [System.Drawing.Icon]::FromHandle($Bitmap.GetHicon())
$File = New-Object System.IO.FileStream($Target, 'OpenOrCreate')
$Icon.Save($File)
$File.Close()
$Icon.Dispose()