winutil/functions/private/Copy-Files.ps1

48 lines
1.7 KiB
PowerShell
Raw Normal View History

Test 2023 11 15 (#1209) * Compile Winutil * fix enable toggle visual shape (#1179) * Compile Winutil * Update README.md (#1142) * Update README.md * Update README.md Update the README.md to be more precise & clear. Fix up grammatical mistakes, allow users to figure out their issues easier. Fix crediting of IRM execution script. * Update README.md * Compile Winutil * replacing the hard-coded paths for windows dir (#1126) * Changed version of python for winget to 3.12 (#1137) * Compile Winutil * Added Programs to the Install List (#1143) * Added the checkboxes of what I want to add * Added duplicati * Added KDE Connect * Added OpenVPN Connect * Added Oracle Virtual Box * Added Paint.net * Fixed an error spotted in the KDE Connect package names * Added the checkboxes into inputXML.xaml * Added the package details to config\applications.json * Reverted changes from winutil --------- Co-authored-by: Chris Titus <contact@christitus.com> * Compile Winutil * New Section: Customize Preferences (inside tweaks section) (#1163) * convert numlock on startup checkboxs into toggle button * convert verboselogon checkbox into toggle button * gui changes : added new section, new style for toggle buttons * convert showfileextentions checkbox into toggle button * convert mouse acceleration checkboxs into togglebutton * manor changes : cleanup, adding tooltips * fix style of toggle tweaks added new style 'labelfortweaks' that fix sytle and give mouse hover effect like previous tweaks that are using checkbox style but here for toggle tweaks we are using label and to make other tweaks style 'labelfortweaks' sytle is used. it mimic the style of checkbox style --------- Co-authored-by: Chris Titus <contact@christitus.com> * Compile Winutil * add Thunderbird (#1165) * Compile Winutil * Update the screenshot in README w/ dark mode (#1173) * took a pr on main and pulling it to test (#1175) * Add Session messenger to the applications list. (#1166) * Update applications.json * Update inputXML.xaml * Compile Winutil --------- Co-authored-by: charlescgs <135472912+charlescgs@users.noreply.github.com> Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> * Compile Winutil * fix enable toggle visual shape --------- Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: aim <aimansadiqrahman@gmail.com> Co-authored-by: edelvarden <42596339+edelvarden@users.noreply.github.com> Co-authored-by: dass2608 <139251779+dass2608@users.noreply.github.com> Co-authored-by: Inventhrice <45127310+Inventhrice@users.noreply.github.com> Co-authored-by: Chris Titus <contact@christitus.com> Co-authored-by: Antun Nitraj <antnitraj@gmail.com> Co-authored-by: Meen Beese <meenbeese@tutanota.com> Co-authored-by: charlescgs <135472912+charlescgs@users.noreply.github.com> Co-authored-by: padsalatushal <padsalatushal@users.noreply.github.com> * Add 2 Applications (#1180) This adds KDE Dolphin File Manager and Sublime Merge. * Compile Winutil * Microwin and fixes (#1184) * Microwin and fixes * comment out product key --------- Co-authored-by: KonTy <KonTy@github.com> Co-authored-by: Chris Titus <contact@christitus.com> * Compile Winutil * Microwin Fixes * Set owner fix for issue (#1184) (#1185) * Microwin and fixes * Fix for #1184, takeown doesn't work on non English Windows --------- Co-authored-by: KonTy <KonTy@github.com> * Compile Winutil * Microwin Fix on Bare Metal Fixes the "The computer restarted unexpectedly" error on a fresh install * Compile Winutil * MicroWin: fixing German and Spanish bugs (#1194) * Fixing German and other languages local issue, also doing some house keeping * Fixed several Microwin bugs * Fixing local bug and adding copy to USB feature * Adding driver injection capabilities and fixing bugs in Microwin --------- Co-authored-by: KonTy <KonTy@github.com> * Compile Winutil * error check before removing mountDir * MicroWin Finalized - fix typo - changed oscdimg from using & to Start-Process * Compile Winutil * winget reinstall addition * Adding Floorp Browser (#1204) * Update applications.json * Khalylexe patch 1 (#2) * Update inputXML.xaml * Update applications.json (#1) * Update applications.json * Update applications.json * Update inputXML.xaml * Compile Winutil * Mercury Browser from Alex313031 (#1206) * Compile Winutil * Add Git Extensions git client (#1201) * Compile Winutil * Add PDFsam Basic (#1198) * Compile Winutil * Add new applications (#1197) * Compile Winutil * fixed typo in a few places. (#1192) * Compile Winutil * Added new tools! (#1190) * Update applications.json Added: - Anki - Clipgrab - clink - copyq - Devtoys - ohmyposh - masscode - portmaster - starship * Update inputXML.xaml added the software to the form --------- Co-authored-by: Chris Titus <contact@christitus.com> * Compile Winutil * Update applications.json (#1187) Added to choco : nilesoft-shell prismlauncher bluestacks flameshot * Compile Winutil * fix unit test * Update functions.Tests.ps1 FIXED * fix trailing comma * Compile Winutil * Update winutil.ps1 --------- Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: Padsala Tushal <57517785+padsalatushal@users.noreply.github.com> Co-authored-by: aim <aimansadiqrahman@gmail.com> Co-authored-by: edelvarden <42596339+edelvarden@users.noreply.github.com> Co-authored-by: dass2608 <139251779+dass2608@users.noreply.github.com> Co-authored-by: Inventhrice <45127310+Inventhrice@users.noreply.github.com> Co-authored-by: Antun Nitraj <antnitraj@gmail.com> Co-authored-by: Meen Beese <meenbeese@tutanota.com> Co-authored-by: charlescgs <135472912+charlescgs@users.noreply.github.com> Co-authored-by: padsalatushal <padsalatushal@users.noreply.github.com> Co-authored-by: AshlynOrSomethin <31773733+AshlynOrSomethin@users.noreply.github.com> Co-authored-by: KonTy <9524513+KonTy@users.noreply.github.com> Co-authored-by: KonTy <KonTy@github.com> Co-authored-by: Khalyl <119526243+Khalylexe@users.noreply.github.com> Co-authored-by: Rodhri Erebo <109485128+erebus05@users.noreply.github.com> Co-authored-by: Julius Vitkauskas <jvitkauskas@users.noreply.github.com> Co-authored-by: Finn Krestel <83225836+FinnKrestel@users.noreply.github.com> Co-authored-by: BladeWDR <ssbarning@gmail.com> Co-authored-by: Albert <87888006+MustCodeAl@users.noreply.github.com> Co-authored-by: Straight <107145976+DaEpicR@users.noreply.github.com>
2023-11-28 16:11:11 -06:00
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)(s) from $path to $destination"
foreach($file in $files)
{
$status = "Copy files {0} on {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-Warning "Unable to Copy all the files due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
}
}