-
Recent Posts
Archives
- May 2012 (26)
- April 2012 (21)
- March 2012 (65)
- February 2012 (94)
- January 2012 (54)
- December 2011 (17)
- November 2011 (11)
- October 2011 (15)
- September 2011 (39)
- August 2011 (57)
- July 2011 (58)
- June 2011 (65)
- May 2011 (53)
- April 2011 (25)
- March 2011 (12)
- February 2011 (18)
- January 2011 (27)
- December 2010 (2)
- November 2010 (14)
- October 2010 (13)
- September 2010 (1)
- June 2010 (11)
- May 2010 (31)
- April 2010 (29)
- March 2010 (19)
- February 2010 (31)
- January 2010 (28)
- December 2009 (11)
- November 2009 (40)
- October 2009 (2)
- September 2009 (8)
- August 2009 (21)
- July 2009 (21)
- June 2009 (27)
- May 2009 (32)
- April 2009 (24)
- March 2009 (41)
- February 2009 (42)
- January 2009 (34)
- December 2008 (30)
- November 2008 (40)
- October 2008 (42)
- September 2008 (52)
- August 2008 (40)
- July 2008 (35)
- June 2008 (38)
- May 2008 (29)
- April 2008 (32)
- March 2008 (59)
- February 2008 (43)
- January 2008 (47)
- December 2007 (30)
- November 2007 (62)
- October 2007 (54)
- September 2007 (43)
- August 2007 (44)
- July 2007 (55)
- June 2007 (57)
- May 2007 (55)
- April 2007 (43)
- March 2007 (61)
- February 2007 (50)
- January 2007 (21)
- December 2006 (7)
- November 2006 (16)
Categories
- .NET
- Active Directory
- Active Directory administration with PowerShell
- Architecture
- BITS
- Books
- COM
- Deep Dive
- DHCP
- DNS
- Events
- Exchange
- File system
- files
- Firewall
- General
- General IT matters
- IT Community
- IT Security
- Learning Powershell
- Math
- Microsoft
- Networking
- Office 2010
- Opinion
- Outlook
- Philosophy
- Powershell
- PowerShell and Active Directory
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- Powershell Basics
- PowerShell User Group
- PowerShell V2
- PowerShell V3
- PSAM
- Rant
- Science Fiction
- Script of the Week
- Scripting
- SQL Server
- Strings
- Technology
- Uncategorized
- Virtualisation
- Walking
- Windows 7
- Windows 8
- Windows 8 Server
- Windows Server 2008
- Windows Server 2008 R2
- WPF
- WSH
Meta
Twitter
- Preparing for the next UG meeting - PowerShell in Server 2012 - too much to choose from 1 week ago
- Reading about regular expressions in #PowerShell . My head is exploding 1 week ago
- Sat in San Diego airport waiting to fly home after an awesome deep dive 3 weeks ago
- #PowerShell Deep Dive is over. Another awesome event. It's the only place I learn something from every session 3 weeks ago
- #PowerShell v3 jobs give many more options - results available across sessions in many cases 3 weeks ago
Category Archives: File system
Unblocking Files with PowerShell v3
There are a number of new features in PowerShell v3 that while not huge like CIM or workflow are os significant help to the hard pressed administrator. One of these is the Unblock-File cmdlet. If you haven’t updated your help … Continue reading
Posted in File system, PowerShell V3
1 Comment
Folder sizes
Question on the forums related to folder sizes and last write time Get-ChildItem -Path “C:\PersonalData\MyBooks\PowerShell and WMI” -Recurse | where { $_.PSIsContainer} | foreach { $size = Get-ChildItem -Path $_.FullName | measure -Sum Length | select -ExpandProperty Sum Add-Member -InputObject … Continue reading
Posted in File system
Leave a comment
Count of files in a folder
I was recently left a comment of a post http://richardspowershellblog.wordpress.com/2009/11/30/updating-access-data/ asking about the how to get the count of files in a folder There are a number of solutions including dropping back to the FileSystem object from VBscript If we … Continue reading
Posted in File system, Powershell Basics
Leave a comment
Changing folder creation date
A question on the forum asked about setting creation date on folders after they have been copied to match the source folder. I created a source folder with three folders and modified the creation dates Set-ItemProperty -Path c:\testsource\folder1 -Name CreationTime … Continue reading
Posted in File system, Powershell Basics
Leave a comment
Folder information on remote machines
A question in the forums wanted to get the date a folder was changed on their domain controllers. This is one way to do it $folder = “Common Files” [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() | select -ExpandProperty DomainControllers | foreach { $dc = $_.Name … Continue reading
Posted in File system, Powershell Basics
Leave a comment
Formatting file listings–the other way
Following on from the previous post I was asked if the bit where we set the case on the file names and extension could be done in a select statement. Simple answer is yes Get-ChildItem | where {-not $_.PSIsContainer} | … Continue reading
Posted in File system, Powershell Basics
Leave a comment
Formatting file listings
A question was left asking about displaying a file listing with the full name in upper case and the extension in lower case. Its one line of PowerShell Get-ChildItem | where {-not $_.PSIsContainer} | sort Fullname | Format-Table @{N=”FullName”; E={$($_.Fullname.ToUpper())}}, … Continue reading
Posted in File system, Powershell Basics
2 Comments
Split-Path & UNC
split-path works with with UNC paths as well as normal paths PS> $path = “\\UNCserver\TFSBuilds\componenet\v11.1\XS11.1\XS11.1_11.1.0.35“PS> Split-Path -Path $path -Parent\\UNCserver\TFSBuilds\componenet\v11.1\XS11.1 PS> Split-Path -Path (get-location) -ParentC:\scripts
Posted in File system
Leave a comment
Removing empty folders
Removing empty folders seems to be a question that crops up on a regular basis. The problem is determining if a folder is empty: it could have subfolders it could have zero length files Both of these cases would register … Continue reading
Posted in File system
1 Comment
Folder and file names
Saw a question in the forums – running Get-ChildItem and wanted the folder containing the file. Could split PSParent and pick the last element or can use a calculated field Get-ChildItem -Path c:\test -Recurse | select FullName, @{N=”Folder”; E={Split-Path -Path … Continue reading
Posted in File system
1 Comment