Skip to content

$Matches variable not set when parsing disk_size during Create-ImageVirtualDisk #411

@msancaktutan

Description

@msancaktutan

When I go to the line that is causing the error, the disk size variable is causing an error. The VM properties are listed below in config.ini. I couldn't see any problems.

PS C:\Users\Root\Desktop\Image\windows-openstack-imaging-tools> New-WindowsOnlineImage -ConfigFilePath $ConfigFilePath
10.12.2025 14:11:18 - Windows online image generation started.
10.12.2025 14:11:19 - Cloud image generation started.
10.12.2025 14:11:20 - Creating Virtual Disk Image: C:\Users\Root\Desktop\Image\files\qcow2\win-2016.vhdx...
10.12.2025 14:11:20 - Successfuly created disk: C:\Users\Root\Desktop\Image\files\qcow2\win-2016.vhdx
10.12.2025 14:11:20 - The variable '$Matches' cannot be retrieved because it has not been set.
Create-ImageVirtualDisk : The variable '$Matches' cannot be retrieved because it has not been set.
At C:\Users\Root\Desktop\Image\windows-openstack-imaging-tools\WinImageBuilder.psm1:1679 char:23
+ ...   $drives = Create-ImageVirtualDisk -VhdPath $vhdPath -Size $windowsI ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Matches:String) [Create-ImageVirtualDisk], RuntimeException
    + FullyQualifiedErrorId : VariableIsUndefined,Create-ImageVirtualDisk

Config.ini vm specs;

# The number of CPU cores assigned to the VM used to generate the image.
cpu_count=4
# RAM (in bytes) assigned to the VM used to generate the image.
ram_size=4294967296
# Disk space (in bytes) assigned to the boot disk for the VM used to generate the image.
disk_size=64424509440

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions