Last active
May 17, 2019 01:01
-
-
Save krisdb2009/d63bff7388df17703cf9124affd0ef68 to your computer and use it in GitHub Desktop.
Replaces all sub-folders in MDT Applications folder with a new SuperLTI.exe if a sub-folder contains SuperLTI.exe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ChildDirectories = Get-ChildItem -Directory -Path "." #Gets all Applications Sub Folders | |
foreach($Directory in $ChildDirectories) { #Loops through each Applications Sub Folder | |
$Files = $Directory.GetFiles() #Gets all files within each Applications Sub Folder | |
foreach($File in $Files) { #Loops through each file within each Applications Sub Folder | |
if($File.Name -eq "SuperLTI.exe") { #If a sub directory within an Applications Sub Folder contains SuperLTI.exe | |
Copy-Item -Path "SuperLTI.exe" -Destination $Directory #Replace it with a copy at Applications root. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment