Extracting .exe file using powershell
<p>I am trying to extract .exe file using powershell without any other tools. </p>

<p>I tried to use System.IO.Compression.ZipFile, but that works only for .zip files.. </p>

<pre><code>$zip_file = Get-Item ("C:\Users\00WORK\gs\gs.exe")
$destination = Get-Item ("C:\Users\tuna")
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip_file,$destination)
</code></pre>

<p>Also tried this, but without any success</p>

<pre><code>start-process C:\Users\Downloads\gs.exe -Argumentlist "/a"
</code></pre>

<p>Tried also this but once again without any succes</p>

<pre><code>$shell = new-object -com shell.application
$zip = $shell.NameSpace(“C:\Users\00WORK\gs\gs.exe”)
foreach($item in $zip.items())
{
$shell.Namespace(“C:\Users\tuna”).copyhere($item)
}
</code></pre>

<p>Thanks for help.</p>