header image

Archive for February, 2010

PSCX: Get-DriveInfo

Posted by: | February 10, 2010 | No Comment |

A simple cmdlet that returns information about the local drives PS> Get-DriveInfo VolumeLabel        Name          UsedSpace          FreeSpace   TotalSize %Free ———–        —-          ———          ———   ——— —– Local Disk         C:\      57,026,994,176    114,771,693,568      160 GB  67 % Local Disk         D:\      11,427,856,384     66,725,654,528   72.786 GB  85 % Local Disk         G:\         759,332,864      1,337,524,224    1.953 GB  64 %     Compare it […]

under: PowerShellV2

UG Recording

Posted by: | February 9, 2010 | No Comment |

Thank you to those people who joined the Live Meeting tonight. The recording details are below.  It will be available for 365 days from now. Richard Siddaway has invited you to view a Microsoft Office Live Meeting recording. View Recording Recording Details     Subject: PowerShell UG     Recording URL: https://www.livemeeting.com/cc/usergroups/view     Recording ID: 5JCG5C     […]

under: PowerShell User Group

PSCX: Set-FileTime

Posted by: | February 8, 2010 | No Comment |

The PowerShell Community Extensions have a cmdlet Set-FileTime that can do the same thing we did in a script earlier.  I have rewritten the script to use the cmdlet 001 002 003 004 005 006 007 008 009 010 011 012 013 014 Get-ChildItem -Path C:\Test\csvtests -Filter "*.xlsx" |  Select Name, CreationTime, LastWriteTime Get-ChildItem -Path C:\Test\csvtests -Filter "*.xlsx" | foreach {     $oldname =  "$_" -replace ".xlsx", ".csv"     $oldfile = Join-Path -Path c:\test\csvtests -ChildPath $oldname     if (Test-Path -Path $oldfile) {         $old = Get-Item -Path $oldfile […]

under: PowerShellV2

Change File Dates

Posted by: | February 7, 2010 | No Comment |

Interesting question on the forums about changing the date of files.  Poster was converting a bunch of video files between formats and wanted the file in the new format to have the creation date of the original file. I had some csv files that i could convert to excel files that mimic the problem 001 […]

under: PowerShellV2

PowerShell, WMI and WQL

Posted by: | February 7, 2010 | No Comment |

Don’t forget the PowerShell UG Live Meeting on Tuesday 9 February at 7:30 GMT . Details can be found here http://msmvps.com/blogs/richardsiddaway/archive/2010/01/24/ug-meeting-9-february.aspx Technorati Tags: PowderShell,user group,WMI

under: PowerShell and WMI, PowerShell User Group, PowerShellV2

I mentioned a while ago that I’d started another blog, mainly based around PowerShell and WMI. it can be found at http://itknowledgeexchange.techtarget.com/powershell/. Recent topics include: defrag analysis of Windows volumes using WMI to chkdsk a volume mapping physical drives to logical drives mount points detailed information of logical and physical disks retrieving information on partitions […]

under: PowerShell and WMI, PowerShellV2

Tail-File

Posted by: | February 5, 2010 | No Comment |

Continuing our ramble through the goodies in PowerShell Community Extensions 2.0 we come to Tail-File. It is fairly easy to get the first n lines of a file. Get-Content -Path C:\Scripts\HelpFiles\About\about_activedirectory_objectmodel.help.txt -TotalCount 15 will display the first 15 lines in the file. This is comparable to the top command.  Getting the last 15 lines is […]

under: PowerShellV2

  Following on from the last post we wanted to be able to look at the table definitions 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 $datatype = DATA { ConvertFrom-StringData -StringData @’ 3 = Integer […]

under: Office 2010, PowerShellV2

We’ve looked quite a bit at how we can work with Access databases but how do we investigate the structure of the database.  The first thing we need to know is the tables in our database 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 function Get-AccessTableDefinition { […]

under: Office 2010, PowerShellV2

Test-Script

Posted by: | February 2, 2010 | No Comment |

I’m going to do a few posts on the PowerShell Community Extensions 2.0 beta i mentioned earlier.  It downloads and installs without a problem. One immediate issue on loading is that it replaces my help function – big no no.  Bad PSCX! I don’t like having my configuration arbitrarily altered.  That I can deal with […]

under: PowerShell original

« Newer Posts

Categories