Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following instructions gives errors, starting with a scratchdisk error #339

Open
linuxgurugamer opened this issue Feb 19, 2025 · 6 comments

Comments

@linuxgurugamer
Copy link

linuxgurugamer commented Feb 19, 2025

Instructions say to run the script (after running Set-ExecutionPolicy unrestricted) and that you will be prompted for where the ISO is mounted.
Doing so generates 52 lines of error, the captured output is below:

tiny11maker.log

The output is below, but the formatting is a bit off due to markup:

`The variable cannot be validated because the value D:\users\jbb\Downloads\Tiny-11\tiny11builder-main is not a valid
value for the ScratchDisk variable.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:10 char:5

  • $ScratchDisk = $PSScriptRoot -replace '[\\]+$', ''
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : MetadataError: (:) [], ValidationMetadataException
    • FullyQualifiedErrorId : ValidateSetFailure

Scratch disk set to
New-Object : Cannot create type. Only core types are supported in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:30 char:13

  • $adminSID = New-Object System.Security.Principal.SecurityIdentifier(" ...
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : PermissionDenied: (:) [New-Object], PSNotSupportedException
    • FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand

You cannot call a method on a null-valued expression.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:31 char:1

  • $adminGroup = $adminSID.Translate([System.Security.Principal.NTAccoun ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
    
    

Cannot invoke method. Method invocation is supported only on core types in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:32 char:1

  • $myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent( ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
    
    

new-object : Cannot create type. Only core types are supported in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:33 char:21

  • ... wsPrincipal=new-object System.Security.Principal.WindowsPrincipal($my ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : PermissionDenied: (:) [New-Object], PSNotSupportedException
    • FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand

You cannot call a method on a null-valued expression.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:35 char:5

  • if (! $myWindowsPrincipal.IsInRole($adminRole))
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Transcript started, output file is \tiny11.log
Cannot set property. Property setting is supported only on core types in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:50 char:1

  • $Host.UI.RawUI.WindowTitle = "Tiny11 image creator"
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : PropertySetterNotSupportedInConstrainedLanguage
    
    

`

@Miiraak
Copy link

Miiraak commented Feb 19, 2025

Hi mate !
I think your execution-police was not well taken.

New-Object : Cannot create type. Only core types are supported in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11maker.ps1:30 char:13

    $adminSID = New-Object System.Security.Principal.SecurityIdentifier(" ...

            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        CategoryInfo : PermissionDenied: (:) [New-Object], PSNotSupportedException
        FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand


Try :

Set-ExecutionPolicy -Scope Process Unrestricted

Accept the change then :

Get-ExecutionPolicy 

Verify that the output is 'Unrestricted' before calling the script.


Plus, the parameter is not the mounted iso, it's the working directory of Tiny11.
But that's not a big issue as he takes script root folder if value is not valid (and yes mounted iso is an invalid value 😉)

@linuxgurugamer
Copy link
Author

Only thing I did differently was doing the Get-ExecutionPolicy, got different output:

Output here:
`PS D:\users\jbb\Downloads\Tiny-11\tiny11builder-main> Set-ExecutionPolicy -Scope Process Unrestricted

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y
PS D:\users\jbb\Downloads\Tiny-11\tiny11builder-main> Get-ExecutionPolicy
Unrestricted
PS D:\users\jbb\Downloads\Tiny-11\tiny11builder-main> dir

PS D:\users\jbb\Downloads\Tiny-11\tiny11builder-main> .\tiny11Coremaker.ps1
New-Object : Cannot create type. Only core types are supported in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11Coremaker.ps1:17 char:13

  • $adminSID = New-Object System.Security.Principal.SecurityIdentifier(" ...
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : PermissionDenied: (:) [New-Object], PSNotSupportedException
    • FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand

You cannot call a method on a null-valued expression.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11Coremaker.ps1:18 char:1

  • $adminGroup = $adminSID.Translate([System.Security.Principal.NTAccoun ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
    
    

Cannot invoke method. Method invocation is supported only on core types in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11Coremaker.ps1:19 char:1

  • $myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent( ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
    
    

new-object : Cannot create type. Only core types are supported in this language mode.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11Coremaker.ps1:20 char:21

  • ... wsPrincipal=new-object System.Security.Principal.WindowsPrincipal($my ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : PermissionDenied: (:) [New-Object], PSNotSupportedException
    • FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand

You cannot call a method on a null-valued expression.
At D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11Coremaker.ps1:22 char:5

  • if (! $myWindowsPrincipal.IsInRole($adminRole))
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Transcript started, output file is D:\users\jbb\Downloads\Tiny-11\tiny11builder-main\tiny11.log
Welcome to tiny11 core builder! BETA 05-06-24
This script generates a significantly reduced Windows 11 image. However, it's not suitable for regular use due to its lack of serviceability - you can't add languages, updates, or features post-creation. tiny11 Core is not a full Windows 11 substitute but a rapid testing or development tool, potentially useful for VM environments.
Do you want to continue? (y/n)

`

Other than the initial errors shown above, it does now appear to be working, will update when it's complete

@linuxgurugamer
Copy link
Author

It finally finished,I dont think it's good, given that there is a 110k log file with lots of errors, see attached:

Log file is zipped for upload

log.zip

@Miiraak
Copy link

Miiraak commented Feb 21, 2025

Hi,

My bad, haven't be attentive in my previous response.
You can verify your LanguageMode. This will output your actual one :

$ExecutionContext.SessionState.LanguageMode

To set the LanguageMode if not :

$ExecutionContext.SessionState.LanguageMode = "FullLanguage"

This will let you use the New-Object cmdlet that is disable when setted to : NoLanguage

@KeyMan98
Copy link

Hi, I solved it using this link. It gave me the same errors too.

#335

@Miiraak
Copy link

Miiraak commented Feb 26, 2025

Hi @KeyMan98

I'm not sure to understand, when you tried tiny11maker.ps1 you get the error

Cannot create type. Only core types are supported in this language mode.

But #335 let you create the ISO ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants