Create ISO image using PowerShell: how to save IStream to file?

一世执手 提交于 2019-11-29 10:10:18

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
Andy Arismendi

You can use the DiscUtils library to make ISOs (and manage other disk formats such as VHD/VHDX, DMG, FAT, etc). A PowerShell module is supported as well an MSBUILD task to automatically create your ISO on project build.

Create a CDBuilder object and go to town with adding files and directories then save it to disk with the Build method. Download documentation here.

 CDBuilder builder = new CDBuilder();
 builder.AddFile("samplefile.txt", new byte[] { });
 builder.Build(@"c:\output.iso");

The great thing about this approach is that it is 100% managed code and cross-platform - there is no IMAPI2 COM/Marshaling requirement.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!