我正在尝试使用PowerShell提取.exe文件,而不需要任何其他工具。
我尝试使用System.IO.Compression.ZipFile,但它仅适用于.zip文件。
$zip_file = Get-Item ("C:\Users\00WORK\gs\gs.exe")
$destination = Get-Item ("C:\Users\tuna")
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip_file,$destination)
我也尝试了这个方法,但没有成功。
start-process C:\Users\Downloads\gs.exe -Argumentlist "/a"
我也尝试了这个,但是还是没有成功。
$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)
}
感谢您的帮助。