使用PowerShell创建ISO映像:如何保存IStream文件? [英] Create ISO image using PowerShell: how to save IStream to file?

查看:1145
本文介绍了使用PowerShell创建ISO映像:如何保存IStream文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows上创建一个ISO映像,所以一个.iso文件。这可以使用COM组件 IMAPI2FS.MsftFileSystemImage ,我找到了有关如何使用此操作的说明PowerShell中的 MSDN标题为在powerhell中使用IMAPI 2写光盘



在步骤3之后,这些指令说在此步骤,您可以停止并保存结果图像到本地硬盘,这将是一个纯iso映像。



我的问题:如何获取$ resultStream,即,COM对象在PowerShell中检索 ImageStream 并将其内容保存到文件中?

解决方案

您需要使用FileStream writer。检查这个链接的一个例子,如何在c#中。
http://tools.start-automating.com/Install-ExportISOCommand /? - 下载



此处的函数可用于创建有助于创建ISO的cmdlet。例如,



运行 Install-ExportISOCommand
这将创建 Export-Iso

然后,使用 Export-ISO 创建一个ISO。

  Export-Iso -ISOPath C:\dropbox\test.iso -FileName C:\Dropbox\Scripts 


I want to create an ISO image, so a .iso file, on Windows. This is possible to do using COM component IMAPI2FS.MsftFileSystemImage, and I found instructions on how to do this using PowerShell in an MSDN blog post entitled "Writing optical discs using IMAPI 2 in powershell".

After step 3, those instructions say that "at this step you can stop and save resulted image to the local hard disc, this will be a pure iso image."

My question: How do I take $resultStream, i.e., a COM object that results from retrieving an ImageStream, in PowerShell and save its contents to a file?

解决方案

You need to use FileStream writer. Check this link for an example of how it is done in c#. http://tools.start-automating.com/Install-ExportISOCommand/?-Download

The function there can be used to create cmdlets that help you create ISO. For example,

Run Install-ExportISOCommand This creates Export-Iso

Then, use Export-ISO to create an ISO.

Export-Iso -ISOPath C:\dropbox\test.iso -FileName C:\Dropbox\Scripts

这篇关于使用PowerShell创建ISO映像:如何保存IStream文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆