Geeks With Blogs
Sean Rhone January 2016 Entries
Finding the newest file in folder using PowerShell
Saw a question like this on Stack Overflow and submitted this answer and thought I'd like to keep it around for future use. The task was to find the newest file in a directory and copy it to another folder.Clear-Host# List of all child folders under base folder$ChildFolders = @('A', 'B')#Iterate over collection of child foldersfor($i = 0; $i -lt $ChildFolders.Count; $i++){ # Build the folder to search for newest folder $FolderPath = "D:\BackupSource\" + $ChildFolders[$i] # Build destination folder ......

Posted On Thursday, January 21, 2016 10:33 AM

Finding the newest file in folder using PowerShell
Saw a question like this on Stack Overflow and submitted this answer and thought I'd like to keep it around for future use. The task was to find the newest file in a directory and copy it to another folder.Clear-Host# List of all child folders under base folder$ChildFolders = @('A', 'B')#Iterate over collection of child foldersfor($i = 0; $i -lt $ChildFolders.Count; $i++){ # Build the folder to search for newest folder $FolderPath = "D:\BackupSource\" + $ChildFolders[$i] # Build destination folder ......

Posted On Wednesday, January 20, 2016 2:38 PM

Powershell & IIS
Posting these so I can find them easily in the future when I need them -- Selects the default documents from the applicationHost.config Get-WebConfigurationProperty -Filter 'system.webServer/defaultDo... -PSPath 'Machine/WebRoot/AppHost' -Name value -- Changes the value of the file name in the defaultDocument list in the applicationHost.config Set-WebConfigurationProperty 'system.webServer/defaultDo... -PSPath 'Machine/WebRoot/AppHost' -Name value ......

Posted On Monday, January 4, 2016 3:00 PM

Copyright © Sean Rhone | Powered by: GeeksWithBlogs.net