mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 09:04:47 -05:00
[MicroWin] Preparation for 2025 (#3066)
* Set Boot Manager entry timeout to 0 Fixes #2562 * Exclude Windows Hello stuff from package removal * Obscure passwords with Base64 and fix indentation Fixes #3064 * Fix name of excluded package * Update comment It reflects my feelings towards Microsoft when it comes to security a lot better * Remove jargon of scratch directory options * Package exclusion improvements - Removed AppX packages from OS package exclusion list - Added exclusion of PowerShell ISE (source: Discord server - yes, some people still use the PowerShell ISE) * Exclude Windows Photo Viewer from dir removal * Improve copy operation to Ventoy drives This change may fix the issues where there's a conflict between both Ventoy's and MicroWin's unattended answer files, causing target images to stop working as expected during OOBE * Add VirtIO functionality and more enhancements - Added the ability to grab VirtIO Guest Tools - Modified the description of the Copy ISO files function because it basically had nonsense * Fix typo (#3104) * Access specific property of ISO image object Only show the ISO path. No one is interested in the storage type * Add detections for expedited app removal They only affect 24H2 and newer. Earlier releases don't have these expedited apps * Update message * Add VirtIO instructions to MicroWin page * Add DISM command fallback This fallback is triggered if an exception occurs while getting information with the cmdlets (I couldn't test this on my host as everything magically works now - sometimes it threw the Class not registered error) * Exclude OpenSSH from package removal Some people need this to avoid installing third-party programs like PuTTY * Fixed some more indentation
This commit is contained in:
@ -2,11 +2,17 @@ function Copy-Files {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
This function will make all modifications to the registry
|
||||
|
||||
Copies the contents of a given ISO file to a given destination
|
||||
.PARAMETER Path
|
||||
The source of the files to copy
|
||||
.PARAMETER Destination
|
||||
The destination to copy the files to
|
||||
.PARAMETER Recurse
|
||||
Determines whether or not to copy all files of the ISO file, including those in subdirectories
|
||||
.PARAMETER Force
|
||||
Determines whether or not to overwrite existing files
|
||||
.EXAMPLE
|
||||
|
||||
Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
|
||||
Copy-Files "D:" "C:\ISOFile" -Recurse -Force
|
||||
|
||||
#>
|
||||
param (
|
||||
@ -23,7 +29,7 @@ function Copy-Files {
|
||||
|
||||
foreach ($file in $files) {
|
||||
$status = "Copying file {0} of {1}: {2}" -f $counter, $files.Count, $file.Name
|
||||
Write-Progress -Activity "Copy Windows files" -Status $status -PercentComplete ($counter++/$files.count*100)
|
||||
Write-Progress -Activity "Copy disc image files" -Status $status -PercentComplete ($counter++/$files.count*100)
|
||||
$restpath = $file.FullName -Replace $path, ''
|
||||
|
||||
if ($file.PSIsContainer -eq $true) {
|
||||
@ -35,7 +41,7 @@ function Copy-Files {
|
||||
Set-ItemProperty -Path ($destination+$restpath) -Name IsReadOnly -Value $false
|
||||
}
|
||||
}
|
||||
Write-Progress -Activity "Copy Windows files" -Status "Ready" -Completed
|
||||
Write-Progress -Activity "Copy disc image files" -Status "Ready" -Completed
|
||||
} catch {
|
||||
Write-Host "Unable to Copy all the files due to an unhandled exception" -ForegroundColor Yellow
|
||||
Write-Host "Error information: $($_.Exception.Message)`n" -ForegroundColor Yellow
|
||||
|
Reference in New Issue
Block a user