HOW TO INCLUDE POWERSHELL SCRIPT IN SCHNEEGANS ?


Tright

New member
Local time
7:40 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 My Computer

At a glance

WINDOWS 11
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 My Computer

At a glance

Linux Mint
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 My Computer

At a glance

Windows 11 Enterprise 25H2 [rev. 8893]
OS
Windows 11 Enterprise 25H2 [rev. 8893]
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 My Computer

At a glance

Windows 7
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 My Computer

At a glance

Windows 10
OS
Windows 10
Back
Top Bottom