Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $ChildDirectories = Get-ChildItem -Directory -Path "." #Gets all Applications Sub Folders
  2. foreach($Directory in $ChildDirectories) { #Loops through each Applications Sub Folder
  3. $Files = $Directory.GetFiles() #Gets all files within each Applications Sub Folder
  4. foreach($File in $Files) { #Loops through each file within each Applications Sub Folder
  5. if($File.Name -eq "SuperLTI.exe") { #If a sub directory within an Applications Sub Folder contains SuperLTI.exe
  6. Copy-Item -Path "SuperLTI.exe" -Destination $Directory #Replace it with a copy at Applications root.
  7. }
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement