Question about corrections for my copy script

2024.11.28 14:30 ChanceOregon68 Question about corrections for my copy script

Hello everyone,
To be directly honest about it, as I'm yet to bad to do it my myself, I used AI for this script, even if I planned to learn it correctly by myself.
I want to copy files from a directory on a external hard drive to a second one (files from the first dir are correct photos that replace non correct photos on the second drive). Problem, the names of directories are not the same from a drive to another, but the names of the files inside are the same. There is also the case of files from second the second drive that are not present on the 1st one, that I need to let untouched (image of a sub-dir for example).
Now the main problem of my script : at the beginning works well, but after some folders, I suppose because of the amount of files, it crashes and my computer with it. What can I do to correct this problem ? Thank you.

# Settings $Dossier1 = "F:\LEAD\Dossier 1" $Dossier2 = "F:\LEAD\Dossier 2" $Rapport = Join-Path $Dossier2 "rapport_anomalies.txt" # Report if (Test-Path $Rapport) { Remove-Item $Rapport -ErrorAction SilentlyContinue } New-Item -Path $Rapport -ItemType File -Force | Out-Null # Check dir if (!(Test-Path $Dossier1)) { Write-Error "Le dossier source $Dossier1 est introuvable." exit } if (!(Test-Path $Dossier2)) { Write-Error "Le dossier destination $Dossier2 est introuvable." exit } # Replace TIF trough all sub-dir function Remplacer-FichiersTIF { param ( [string]$Source, [string]$Destination ) # Get all TIF $FichiersSource = Get-ChildItem -Path $Source -Recurse -Filter "*.tif" -ErrorAction SilentlyContinue $FichiersDestination = Get-ChildItem -Path $Destination -Recurse -Filter "*.tif" -ErrorAction SilentlyContinue # Index of dest. files by name $IndexDestination = @{} foreach ($Fichier in $FichiersDestination) { $IndexDestination[$Fichier.Name] = $Fichier } # src files foreach ($FichierSource in $FichiersSource) { $NomFichier = $FichierSource.Name if ($IndexDestination.ContainsKey($NomFichier)) { $FichierDestination = $IndexDestination[$NomFichier] # Files length $TailleSource = (Get-Item $FichierSource.FullName).Length $TailleDestination = (Get-Item $FichierDestination.FullName).Length if ($TailleSource -ne $TailleDestination) { # Replace if length not the same Copy-Item -Path $FichierSource.FullName -Destination $FichierDestination.FullName -Force -ErrorAction Stop Write-Host "Remplacé : $($FichierSource.FullName) -> $($FichierDestination.FullName)" } else { # Not replaced if same lenghthn, report Add-Content -Path $Rapport -Value "NON REMPLACÉ (même taille) : $($FichierSource.FullName)" Write-Host "Non remplacé (même taille) : $($FichierSource.FullName)" } } else { # Report if file don't existe in Dir 2 Add-Content -Path $Rapport -Value "ANOMALIE : $($FichierSource.FullName) non trouvé dans le dossier 2" Write-Host "Anomalie : $($FichierSource.FullName) non trouvé dans le dossier 2" } } } # Execute try { Remplacer-FichiersTIF -Source $Dossier1 -Destination $Dossier2 Write-Host "Traitement terminé. Rapport d'anomalies : $Rapport" } catch { Write-Error "Erreur critique : $($_.Exception.Message)" } 
submitted by ChanceOregon68 to PowerShell [link] [comments]


2024.11.28 14:30 MasterpieceLoud4931 Crypto hackers steal $71M in November, bringing yearly total to $1.48B

Crypto hackers steal $71M in November, bringing yearly total to $1.48B submitted by MasterpieceLoud4931 to ethtrader [link] [comments]


2024.11.28 14:30 Equalizer6338 Welcome to our Eversense community here on Reddit!

Welcome to this new subreddit for the Eversense CGM system!
Here we can help each other to troubleshoot the Eversense CGM, share our experiences, ask questions related to the Eversense sensors, the app, the insertion procedure, share Eversense news, brag, commiserate or vent.
submitted by Equalizer6338 to eversense [link] [comments]


2024.11.28 14:30 lawsat22 I'm ready for the hate. After the whole "blessed account" i had was done. This definitely makes me happy within 4 pulls got these beauties

I'm ready for the hate. After the whole submitted by lawsat22 to WatcherofRealmsGame [link] [comments]


2024.11.28 14:30 xfl7 in vivo oncology jobs for PhD level scientist. Will I be forever siloed into mouse modeling?

I'm currently an industry postdoc in discovery oncology research and I have all the fancy skillset for in vitro oncology work and I have not touched a mouse since I finished my PhD. My PhD was in immuno-oncology which was heavy on the in vivo mouse modeling. Currently looking into moving into senior scientist positions and in early to late interview stages. As my luck would have it, I have progressed a lot more in interviews for in vivo oncology jobs than in vitro oncology discovery, even though I applied to just two in vivo oncology jobs and will likely get an offer from at least one of the two positions soon (in one of the big pharmas).
I have come to learn that for these positions it's extremely hands-on mice tumor modeling with room for nothing else aside from flow cytometry. Based on my conversations during interviews, I fear that I will be siloed into mouse modeling without getting managerial opportunities and this may stunt my career growth
Wondering if my fear is well founded and if I can get advice from people that may have been in similar positions in the past. I could ride out my post-doc for a while longer and pursue other opportunities or I could consider in vivo oncology scientist position which isn't as glamorous as it sounds.
submitted by xfl7 to biotech [link] [comments]


2024.11.28 14:30 Theo04t I feel emasculated and erased when girls treat me like the gay best friend

I’m 20M and during my lifetime I have a met several girls that were my friends who every single day could call me gay and present me to everybody as gay, and that was it. I wasn’t a guy or a bi guy I was “the gay”. I never knew how to explain it but it made me feel erased in my sexuality and also emasculated, as I was “the gay” I was expected to be super flamboyant, and for some things I would say that I am more feminine, but for the most part not really that much.
submitted by Theo04t to bisexual [link] [comments]


2024.11.28 14:30 r3crac Xiaomi Portable Dual Mode Keyboard Wireless XMBXJP01YM for 29.99 USD without coupon (Best price in history: 32.99 USD)

Here is the link (Banggood): Xiaomi Portable Dual Mode Keyboard Wireless XMBXJP01YM
Current price is 29.99 USD. The lowest price in my database is 32.99 USD.There're already 3 records in DB. Price monitoring since 28.10.2024!
If you're too late or you want e-mail PRICE ALERTS, then you can check current coupons for Xiaomi Portable Dual Mode Keyboard Wireless XMBXJP01YM here: https://couponsfromchina.com/xiaomi-portable-dual-mode-keyboard-wireless-xmbxjp01ym-discount-price/
Best regards.
This is an example of a real deal with nice discount.
Image: https://i.imgur.com/FlMVEvM.jpeg
submitted by r3crac to xiaomi_discount [link] [comments]


2024.11.28 14:30 Alarmed_Broom Romantasy friends

Hello! I have seen on a fair few Instagram posts ‘I wish I had friends to sent this to’ and people don’t have anyone to share their deep and obsessive love of romantasy with. I don’t either. And I want some. I want friends to share recommendations with, hang out with, meet up with. Ideally IRL. I want best friends who want friends to text every day. I’m based in the U.K. (Kent more specifically) and if there’s anyone out there who feels like me let’s be friends. I mean it ☺️ let’s be these guys (we don’t have to start an Instagram or podcast or anything, friendship based in bookishness is more than enough 💕)
submitted by Alarmed_Broom to acotar [link] [comments]


2024.11.28 14:30 bumblesack Screenshot of your highest CP mons

I feel like my highest CP mons are really not that high. I would love to see what all of your highest CP mons are and which mons claim that title. Happy Thanksgiving!
submitted by bumblesack to pokemongo [link] [comments]


2024.11.28 14:30 OkBelt8382 Why ?!

Some people get their approval quickly like in 2 months while others take 7 m at least They are the same type of lmia, nearly the same dates of submission and payments. Could anyone clarify that ?
submitted by OkBelt8382 to lmiaprocessing [link] [comments]


2024.11.28 14:30 UnfairHelp1822 Rey Mysterio Reflects On Dominik’s WWE Rise Compared To His Own Journey

Rey Mysterio Reflects On Dominik’s WWE Rise Compared To His Own Journey submitted by UnfairHelp1822 to CodyRhodes [link] [comments]


2024.11.28 14:30 YaranaRouja [USERNAME: UNKNOWN] [REAL NAME: UNKNOWN] [AGE: 22] [MALE] (One of the weird guys who watched a teenager get strangled to death by a vine.) (He likes all types of desserts, but he likes ice cream even more!) (When feeling bored, he would chill with random players.) (Thinks his 'home' is kinda cool.)

[USERNAME: UNKNOWN] [REAL NAME: UNKNOWN] [AGE: 22] [MALE] (One of the weird guys who watched a teenager get strangled to death by a vine.) (He likes all types of desserts, but he likes ice cream even more!) (When feeling bored, he would chill with random players.) (Thinks his 'home' is kinda cool.) submitted by YaranaRouja to ARoad_RobloxSeries [link] [comments]


2024.11.28 14:30 taargusmistoffelees How do I clean my couch?

How do I clean my couch? I have a toddler so I’m constantly cleaning up little messes from the couch. Anytime I do, it leaves a water mark. It’s also hard to clean because the fabric is textured.
submitted by taargusmistoffelees to CleaningTips [link] [comments]


2024.11.28 14:30 Irobert1115HD spot on work by smoothdunk.

https://bsky.app/profile/smoothdunk2.bsky.social/post/3lbtpnslnrk2z
submitted by Irobert1115HD to EnoughMuskSpam [link] [comments]


2024.11.28 14:30 YummyxYum Shuhua

Shuhua submitted by YummyxYum to kpopSlowMo [link] [comments]


2024.11.28 14:30 Affectionate-Snow-52 Love my Ram

Just thought I would share!!!
submitted by Affectionate-Snow-52 to ram_trucks [link] [comments]


2024.11.28 14:30 ruzumec_ Parkta kedi buldum kelepir fiyata bırakırım

Parkta kedi buldum kelepir fiyata bırakırım submitted by ruzumec_ to KGBTR [link] [comments]


2024.11.28 14:30 bankstatements32 I like the colour blue

submitted by bankstatements32 to ShareYourSelfie [link] [comments]


2024.11.28 14:30 Free_dew4 [Meta] Goldy Pond is (obviously) fan favorite, what arc or season is made to be hated

Rules:

  1. No repetition allowed
  2. Most upvoted comment wins
  3. Manga arcs, Anime arcs and even Anime seasons are allowed
submitted by Free_dew4 to thepromisedneverland [link] [comments]


2024.11.28 14:30 morph_drusseldorf Does the treatment industry need to divest from insurance funding?

I've only been in the field for 1.5 years so excuse any ignorance. I just had this shower thought last night and wanted some feedback. In my mind, insurance companies paying for addiction treatment, is like a surgeon chopping off your arm and going "I'll sew it back on for $1500." The medical industry is largely responsible for the opioid crisis, imo they should not be benefitting from its treatment. Paying for it, sure, but they shouldn't get a dime. I know that tons of good happens in the recovery industry...but that's because of us! Not sure how else it would be paid for, but the whole thing feels like a self-feeding scam.
submitted by morph_drusseldorf to DrugCounselors [link] [comments]


2024.11.28 14:30 Realistic_Device2500 Is Dex available on Samsung Tab S9 FE?

I just heard about it and can't see it anywhere. This is a recent tablet and from what I can tell it's supposed to be supported but I can't find it anywhere. It's not in the drop down menu.
submitted by Realistic_Device2500 to SamsungDex [link] [comments]


2024.11.28 14:30 MugShots Court records reveal new information about 9 Chillicothe child abuse arrests

Court records reveal new information about 9 Chillicothe child abuse arrests submitted by MugShots to ArrestStories [link] [comments]


2024.11.28 14:30 gabyleann Recs for cute animations?

My teenage sim is about to get her first boyfriend so I’m looking for cute animations for them, please! Possibly some of them having to be sneaky because she’s a ✨pious✨ girl and doesn’t want her family knowing 🤭 Thanks y’all!!
submitted by gabyleann to sims4cc [link] [comments]


2024.11.28 14:30 RatGod4 Raspberry Torte 😁

submitted by RatGod4 to BadArt [link] [comments]


2024.11.28 14:30 Ton1_Visuals No signal after new RAM

I just put new ram in my pc. Everything was fine, but after a few minutes the monitor goes black and says No signal, pc still works. I took out the ram and put it back in and it worked again, again after a few minutes the same thing happens.
submitted by Ton1_Visuals to pcmasterrace [link] [comments]


https://google.com/