使用 PowerShell 创建 ISO 映像:如何将 IStream 保存到文件? [英] Create ISO image using PowerShell: how to save IStream to file?
问题描述
我想在 Windows 上创建一个 ISO 映像,即 .iso 文件.使用 COM 组件 IMAPI2FS.MsftFileSystemImage 可以做到这一点,我找到了有关如何使用的说明一个 MSDN 中的 PowerShell题为在 powershell 中使用 IMAPI 2 写入光盘"的博文.
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".
在第3步之后,那些说明说在这一步你可以停止并将结果图像保存到本地硬盘,这将是一个纯iso图像."
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."
我的问题:我如何获取 $resultStream,即从检索 ImageStream得到的 COM 对象a>,在 PowerShell 中并将其内容保存到文件中?
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?
推荐答案
你需要使用 FileStream writer.检查此链接以获取如何在 c# 中完成的示例.http://tools.start-automating.com/Install-ExportISOCommand/?-Download
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
那里的功能可用于创建帮助您创建 ISO 的 cmdlet.例如,
The function there can be used to create cmdlets that help you create ISO. For example,
运行 Install-ExportISOCommand
这将创建 Export-Iso
然后,使用 Export-ISO
创建一个 ISO.
Then, use Export-ISO
to create an ISO.
Export-Iso -ISOPath C:dropbox est.iso -FileName C:DropboxScripts
这篇关于使用 PowerShell 创建 ISO 映像:如何将 IStream 保存到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!