x0nn / Convert-WindowsImage

Creates a Windows VM for Hyper-V from a Windows-ISO
GNU General Public License v3.0
80 stars 21 forks source link

The variable "$WindowsImage" cannot be retrieved because it is not set. #22

Closed Drovosek01 closed 3 years ago

Drovosek01 commented 3 years ago

I downloaded it .the zip archive of the repository with the latest changes, unzipped and did what is written in the readme, but received such an error

WriteLogMessage : 2021-10-16T13:20:25 [DESKTOP-FOTEH5P] The variable "$Windows Image" cannot be retrieved because it is
not set.
D:\Convert-WindowsImage-main\Convert-WindowsImage.ps1:2350 sign:13

image

suntong commented 3 years ago

Yep, I got that too, but I believe with a newer version than @Drovosek01's.

I got:

The variable '$openImage' cannot be retrieved because it has not been set

Seems @x0nn is working on it 😀

From my log:

Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe
Process ID: 22336
PSVersion: 5.1.19041.1237
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.1237
BuildVersion: 10.0.19041.1237
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1

The culprit line is:

https://github.com/x0nn/Convert-WindowsImage/blob/109ddc9531560911b2c28772fad9ef346c55c38c/Convert-WindowsImage.ps1#L2063

and indeed there is only one $openImage in the whole file.

x0nn commented 3 years ago

It was a copy paste error. Please retest.

suntong commented 3 years ago

yep, fixed.

Drovosek01 commented 3 years ago

The error keeps popping up image

It on Windows 10 x86. I just try make .vhdx from Windows 10 .iso for ARM.

suntong commented 3 years ago

Hi @Drovosek01, are you using the latest script directly from git master?