Covered Here,... script will work on Build 21301 (if you are prepared to do the work - not really that difficult)
Does the file - Set-Additional.ps1 - make a copy of the org settings? If so, where and how to restore these org settings? Now, to restore org settings, I have to reinstall the system - I don't know how to restore these org settings.
Code: # Before stopping and disabling any Scheduled Task, export their default values as a JSON file. This way we can revert any change back to default if required. Get-ScheduledTask | Select-Object -Property TaskName, Description, TaskPath, State | ForEach-Object -Process { [PSCustomObject] @{ TaskName = $PSItem.TaskName; Description = $PSItem.Description; TaskPath = $PSItem.TaskPath; State = $PSItem.State; SetState = 'Disabled' } } | ConvertTo-Json | Out-File -FilePath .\DefaultScheduledTasks.json Line 27 to 29 seems to exactly do that, if I am not mistaken. What I don't know is if there is a script to revert the saved default settings. EDIT: Lines 38 to 40 do the same for services.
If you Copy and Rename DefaultScheduledTasks.json to ScheduledTasks.json and replace the one in the setup folder Surely all you would then have to do is run Set-Additional.ps1 again (Online) to restore Defaults,... just a guess
That sounds pretty reasonable. Other question in that direction: Are these scripts (Set-Additional and Remove-OneDrive) supposed to be executed after system installation? I read the code and could not find any connection to the main scripts which are executed during optimization.
Indeed Applied via Configuration.json Code: "Additional": { "Setup": true, also... it goes without saying that ScheduledTasks.json, Services.json, Set-Additional.ps1 and SetupComplete.cmd all need to be examined and edited to suit your own personal requirements, prior to running the script.
I encountered the same problem - does anybody have an idea? I can confirm that it has something to do with Set-Additional.ps1 - I have just restored my VM to an earlier state and it is working again. I'll try to find out myself where the problem is once I have some free time. EDIT: I just noticed that this has been partly answered before: It is WpnUserService in line 59 of Set-Additional.ps1 which you need to comment out. If you want to quickly reverse the change, you can enter the following into an elevated PowerShell prompt: Code: Get-ChildItem -Path "HKLM:\SYSTEM\CurrentControlSet\Services" | Where-Object -Property Name -Like *WpnUserService* | Set-ItemProperty -Name Start -Value 2 -Force -PassThru | Set-ItemProperty -Name UserServiceFlags -Value 3 -Force Afterwards, it was working normally again for me.
Hi. Is there any way to implement onedrive Remove-OneDrive.ps1 and/or Set-Additional.ps1 to be executed in SetupComplete.cmd? Every time I want to to this, setup is 'corupted'. I know that commands in SetupComplete shouldn't give any output so I edited powershell scripts to not show / ask anything user but it's still not working. Redirecting output to nul not helps at all.
You need to run this as administrator after installation. Path C: Windows / Setup / Scripts SetupComplete does this - you don't need to do anything in the scripts. Applied via Configuration.json "Additional": { "Setup": true, # 749 - read on
I tried it like that, but I had issues to what SerpentDash is talking about - setup is 'corupted'. So left my SetupComplete.cmd without a call to Set-Additional.ps1 and there was no error in setup. I just executed it after installation.
Anyone know how to get Optimise Offline to work on an x86 ISO. Tried editing stuff with Notepad++, no luck.
Remove this from Optimize-Offline.psm1 Code: If ($InstallInfo.Architecture -ne 'amd64') { $PSCmdlet.WriteWarning($OptimizeData.UnsupportedImageArch -f $InstallInfo.Architecture) $TempDirectory | Purge Break }
I have installed the optimized image into a VM and booted into Audit mode to sysprep and capture it via FOG Server for deployment. I am trying to do as many things before sysprep as possible as to avoid having to do them on every system. It seems that something in Set-Additional.ps1 interferes with sysprep. Whenever I try to sysprep the installation after executing Set-Additional.ps1, a reboot into installation gets stuck before it gets to OOBE. Does anyone here happen to know which of the stopped services or tasks (or anything other) might cause this?