mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-22 05:51:30 -06:00
1404efab26
* Fix minor denomination problem for packages * Fix incorrect filter of OS packages Packages such as the metadata for capabilities (FoDs) or the foundation package were being incorrectly filtered. They were part of `Remove-ProvisionedPackages`, which only removes AppX packages. These are **OS packages**, something completely different * Fixed indentation * Exclude `Microsoft-RemoteDesktopConnection` Exclude that from feature list. Fixes #2705 * Remove DISM from AppX removal listings DISM is a system component. It will never be an AppX package. This is unnecessary * Improve error handling for file copy * Remove space (for some reason) Compilation script is very adamant that this should be this way * Exclude the VBSCRIPT Features on Demand from pkgs Exclude the VBSCRIPT feature on demand (or capability) from package removal. Some people were reporting that excluding VBSCRIPT fixed problems with AMD chipset drivers on MicroWin * Exclude Recall from feature listings This fixes problems people were experiencing where the file explorer would go back to the Windows 10 layout * Improve error output * Add 24H2 to release list * Detect Windows 10 and show compatibility dialog * Disable some insane desktop stuff on Windows 10 I've only been able to disable Search Highlights. News and Interests persists * Change policy for News and Interests Avoid showing "Access denied" errors for this. This is still broken - News and Interests is still there. [louder]Linus Torvalds curse word here[/louder] Anyway, if someone wants to give setting this up a shot, send me suggestions on how to do this * Write suggestion for AV * Hold errored packages in a list Items are being added correctly, but I can't get that to show to the end-user. Perhaps a different approach will work * Remove older Windows versions from download list Sadly, the links for these had been removed by Microsoft, in favor of the latest version (24H2) * Add sorting to error messages Thanks @og-mrk for the suggestion and the patch (even though I applied it myself) * Make error messages easier to view (#1) * Make error messages easier to view * Improve error output --------- Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com> * Disable Recall on first run Keeps the Explorer look of modern Windows 11 builds whilst removing the Recall feature (which I think will manifest itself on PCs with Lunar Lake processors) * Replace "C:\" with environment variable This still works on single-boot configurations, but presents a more dynamic approach * Fix Volume Mixer issues and removal of leftovers Fix originally from @MyDrift-user on #2856 * Add missing piece to last commit * Default to downloading OSCDIMG from GitHub repo Chocolatey may not be the way to help us detect the presence of OSCDIMG. Everyone, unless someone REALLY uses old deployment technology, has moved to Windows ADK 10.0 * Fix Sorting of Errored Packages by using 'Sort-Object' instead of 'IComparer' approach (#2) Fixes startup issues in PWSH 7 * Remove reference to News and Interests from output Even though the logic is still there, it doesn't work. I don't want to deal with that anymore. Search Highlights, on the other hand, is removed very easily * Exclude License packages from removal They throw an "Access denied" error when trying to remove them. This is a timesaver --------- Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
48 lines
1.9 KiB
PowerShell
48 lines
1.9 KiB
PowerShell
function Copy-Files {
|
|
<#
|
|
|
|
.DESCRIPTION
|
|
This function will make all modifications to the registry
|
|
|
|
.EXAMPLE
|
|
|
|
Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
|
|
|
|
#>
|
|
param (
|
|
[string]$Path,
|
|
[string]$Destination,
|
|
[switch]$Recurse = $false,
|
|
[switch]$Force = $false
|
|
)
|
|
|
|
try {
|
|
|
|
$files = Get-ChildItem -Path $path -Recurse:$recurse
|
|
Write-Host "Copy $($files.Count) file(s) from $path to $destination"
|
|
|
|
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)
|
|
$restpath = $file.FullName -Replace $path, ''
|
|
|
|
if ($file.PSIsContainer -eq $true) {
|
|
Write-Debug "Creating $($destination + $restpath)"
|
|
New-Item ($destination+$restpath) -Force:$force -Type Directory -ErrorAction SilentlyContinue
|
|
} else {
|
|
Write-Debug "Copy from $($file.FullName) to $($destination+$restpath)"
|
|
Copy-Item $file.FullName ($destination+$restpath) -ErrorAction SilentlyContinue -Force:$force
|
|
Set-ItemProperty -Path ($destination+$restpath) -Name IsReadOnly -Value $false
|
|
}
|
|
}
|
|
Write-Progress -Activity "Copy Windows 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
|
|
Write-Host "Additional information:" -ForegroundColor Yellow
|
|
Write-Host $PSItem.Exception.StackTrace
|
|
# Write possible suggestions
|
|
Write-Host "`nIf you are using an antivirus, try configuring exclusions"
|
|
}
|
|
}
|