ISOHelper is a PowerShell module for creating ISO image files from a source directory on Windows by using the native Windows IMAPI2 API.
Import the module and create an ISO in one command:
Import-Module .\ISOHelper.psd1
New-ISOImageFile -SourcePath 'C:\Files' -DestinationPath 'C:\Output\image.iso'- Creates an ISO from a directory tree
- Supports an optional volume label
- Can include the source directory itself at the ISO root
- Can overwrite an existing ISO file with
-Force - Returns a
FileInfoobject for the created ISO
- Windows 10 or Windows Server 2016 or later
- Windows PowerShell 5.1 or later, or Powershell 7.6.0 or later
This module utilizes a Windows-only API and is not supported on non-Windows platforms.
Install-Module -Name ISOHelper -Scope CurrentUserClone or copy the module folder into a location on your system, then import it:
Import-Module .\ISOHelper.psd1Or import the module file directly:
Import-Module .\ISOHelper.psm1If the module is stored in a folder named ISOHelper, you can also import it by folder path:
Import-Module .\ISOHelperISOHelper exports one public function:
New-ISOImageFile
Create an ISO from the contents of a folder:
New-ISOImageFile -SourcePath 'C:\Files' -DestinationPath 'C:\Output\image.iso'Create an ISO with a custom volume label and overwrite the destination if it already exists:
New-ISOImageFile -SourcePath 'C:\Files' -DestinationPath 'C:\Output\image.iso' -VolumeLabel 'MYDISC' -ForceCreate an ISO where the source folder itself appears at the root of the image:
New-ISOImageFile -SourcePath 'C:\Files' -DestinationPath 'C:\Output\image.iso' -IncludeSourceDirectoryRequired. Path to the source directory whose contents will be added to the ISO.
Required. Path to the ISO file to create. The parent directory must already exist.
Optional. Volume label for the ISO image. Default: cidata
Optional switch. When set, the source directory itself is added as a folder at the ISO root instead of only its contents.
Optional switch. Overwrites an existing ISO file at the destination path.
Optional. Controls how many blocks are read per stream read call. Higher values may reduce overhead but use more memory. Default: 64
Optional. Selects the media type used to determine default image settings. Default: IMAPI_MEDIA_TYPE_CDR
Supported values:
IMAPI_MEDIA_TYPE_CDRIMAPI_MEDIA_TYPE_CDRWIMAPI_MEDIA_TYPE_DVDRAMIMAPI_MEDIA_TYPE_DVDPLUSRIMAPI_MEDIA_TYPE_DVDPLUSRWIMAPI_MEDIA_TYPE_DVDPLUSR_DUALLAYERIMAPI_MEDIA_TYPE_DVDDASHRIMAPI_MEDIA_TYPE_DVDDASHRWIMAPI_MEDIA_TYPE_DVDDASHR_DUALLAYERIMAPI_MEDIA_TYPE_DISKIMAPI_MEDIA_TYPE_DVDPLUSRW_DUALLAYERIMAPI_MEDIA_TYPE_BDRIMAPI_MEDIA_TYPE_BDRE
The function returns a FileInfo object for the created ISO file.
- If the destination file already exists and
-Forceis not specified, the command fails. - The module uses a small internal C# helper to write the ISO stream to disk.
- The destination path validation checks that the parent directory exists.
- If another loaded module exports a function with the same name, you may need to call it by module-qualified name:
ISOHelper\New-ISOImageFileThis project is licensed under the terms of the included LICENSE file.