HOW TO INCLUDE POWERSHELL SCRIPT IN SCHNEEGANS ?


Tright

New member
Local time
5:28 PM
Posts
1
OS
WINDOWS 11
Good morning everyone, how are you? Could you help me? I'm trying to include scripts to run alongside the Windows installation response file, in this case Scheegenans.de, but the file won't run. Has anyone here done this? In my case, it would just be a script to install the programs via PowerShell.

Thanks
 
Windows Build/Version
WINDOWS 11 25H2

My Computer

System One

  • OS
    WINDOWS 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asrock
I don't believe you can directly include a powershell script; however, you can call a powershell script from the batch file you can include
 

My Computer

System One

  • OS
    Linux Mint
    Computer type
    Laptop
    Manufacturer/Model
    System76 Lemur Pro
I have a script in my $OEM$\$1\scripts, and I call it like so...

XML:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" etc="etc">
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <Order>8675309</Order>
                    <CommandLine>PowerShell.exe -NoLogo -NoProfile -ExecutionPolicy RemoteSigned -File &quot;C:\scripts\Flawless-PowerShell-Script.ps1&quot;</CommandLine>
                </SynchronousCommand>
            </FirstLogonCommands>
        </component>
    </settings>
</unattend>
 

My Computer

System One

  • OS
    Windows 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Core i7-1260P
    Motherboard
    NUC12WSBi7
    Memory
    64 GB Micron PC4-25600
    Graphics Card(s)
    Intel Iris Xe Graphics
    Sound Card
    on-board Realtek HD Audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840 x 2160
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Crucial MX500 2 TB
    Antivirus
    Microsoft Defender
Run custom scripts: provides (5) text boxes where you can copy/paste a script, and select their extension (.cmd, .reg, .ps1, .vbs, .js).

Sample scripts are displayed here:
Sample scripts for autounattend.xml files

It's unclear if there's a script length limitation, but some users have speculated an answer file can grow into the 32K-ish size. The most common problem in running PS scripts (or any script) in unattended mode is remembering you're mostly running as SYSTEM, keeping track of folder paths. You don't have to change the Execution Policy since the generator wraps everything for you.
 

My Computer

System One

  • OS
    Windows 7
It's unclear if there's a script length limitation, but some users have speculated an answer file can grow into the 32K-ish size.
The URL that results from a form submission of my service must not exceed 64k characters in length. This is due to hard-coded limit in .NET's System.Uri class. I regularly use embedded scripts with a combined length of more than 50k characters without any issues, and the resulting file size is therefore more than 100 KB.
 

My Computer

System One

  • OS
    Windows 10

Latest Support Threads

Back
Top Bottom