Browse by Tags

All Tags » Powershell (RSS)

Excel 2010 beta

  The beta still allows those of us that aren’t in the USA to use the simple method of creating a new spreadsheet using PowerShell. 001 002 003 $xl   =   New-Object   -comobject   "excel.application"   $xl . visible...
Posted by RichardSiddaway | with no comments
Filed under: ,

Reminders via WPF

If I am working on my home machine I don’t necessarily have Outlook or any other application that gives me calendaring capability open. There are times when I need a simple reminder to do something. For some reason I always seem to have PowerShell open...
Posted by RichardSiddaway | with no comments

WMI CookBook: WMI Presentation

As with other PowerShell objects there is a default format for the display of WMI objetcs. If we look at the NetworkAdapter class PS> Get-WmiObject -Class Win32_NetworkAdapter -Filter "DeviceId='11'" ServiceName     ...
Posted by RichardSiddaway | with no comments

Patch Tuesday

Patch Tuesday – the second Tuesday in the month – is the day Microsoft (and other vendors) release their patches. If you want to be able to plan ahead for these dates ( like arranging holiday or sick leave ) these two functions will supply the dates to...
Posted by RichardSiddaway | with no comments
Filed under:

Scheduled Tasks

Keeping on the theme of Scheduled Tasks I wanted to dig into the tasks that exist on my system.  I did a fresh install of Windows 7 in August and haven’t created any scheduled tasks – so what I see should be close to the system defaults.  This...

Cleaning the Temp folder - Scheduling

When I posted about cleaning the temp folder http://msmvps.com/blogs/richardsiddaway/archive/2009/11/04/cleaning-temp-folder.aspx I said I would look at scheduling the task.  I had intended to use the TaskScheduler module in the new PowerShell pack...
Posted by RichardSiddaway | with no comments

Extension for temporary files

When I did the post on creating temporary files http://msmvps.com/blogs/richardsiddaway/archive/2009/11/05/creating-temporary-files.aspx I said I’d modify it so the file would be created with a given extension. 001 002 003 004 005 006 007 008 009 010...
Posted by RichardSiddaway | with no comments

Getting Change Events

I wasn’t particularly happy with the script for getting change events on the filesystemwatcher we discussed last time.  As a quick recap we ended up with this 001 002 003 004 Get-Event   -SourceIdentifier   "File System Changed"...
Posted by RichardSiddaway | with no comments

Watching the file system

We saw how to watch for WMI events http://msmvps.com/blogs/richardsiddaway/archive/2009/11/07/powershell-wmi-events.aspx . In this post we will look at watching the file system. This time we will use the .NET System.IO.FileSystemWatcher object which means...
Posted by RichardSiddaway | with no comments

Multiple test files

Back here http://msmvps.com/blogs/richardsiddaway/archive/2009/11/05/creating-temporary-files.aspx or http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!2595.entry I showed how to create temporary test files. We can simply create multiple...
Posted by RichardSiddaway | with no comments

Removing empty folders

I blogged about this a long time back. As part of my tidy up program (me? tidy up? - - stop laughing!) I’ve been moving scripts into PowerShell v2 modules.  I’ve added these three functions to my FileFunctions module. 001 002 003 004 005 006 007...
Posted by RichardSiddaway | with no comments
Filed under:

Creating Temporary files

One thing I need to do when testing file system scripts is generate a bunch of temporary files for experimenting with.  In the past I have just copied in whatever I could find to use as test data.  It is possible to easily generate test data...
Posted by RichardSiddaway | 2 comment(s)
Filed under:

Cleaning Temp folder

Windows uses a temporary folder as a scratch pad and dumping ground for all sorts of temporary files.  There are a couple of issues with the temporary folder. Firstly by default its part your profile and each user has their own. Secondly there isn...
Posted by RichardSiddaway | 1 comment(s)
Filed under:

No PowerShell = No Job?

James has an excellent post - http://blogs.technet.com/jamesone/archive/2009/11/02/you-can-t-be-a-21st-century-admin-without-powershell.aspx – explaining why PowerShell is going to be a must have skill for IT admins going forward. As far as I am concerned...
Posted by RichardSiddaway | with no comments
Filed under:

Date and Time

I recently came across a script that used date and time information in this manner 001 002 003 004 005 006 $stuff   =   "Stuff" $monthday   =   Get-Date   -Format   "ddMMM" $year   =   Get-Date...
Posted by RichardSiddaway | with no comments
Filed under:

Enable Ping

I’ve got a few talks coming up so need to build some more demo machines.  One thing I like to be able to do in the demo environment is ping between machines – sometimes necessary when testing things out but ping is disabled by the Windows firewall...
Posted by RichardSiddaway | with no comments
Filed under:

TCP Ports

I came across this post http://www.expta.com/2009/08/name-that-port.html that gives the well known service for a TCP\UDP port.  Useful script but its written in VBScript.  Needs to be in PowerShell. 001 002 003 004 005 006 007 008 009 010 011...
Posted by RichardSiddaway | with no comments
Filed under:

Windows 2008 R2 RTM

It hasn’t had the same level of fanfares but Windows Server 2008 R2 RTM is available for download from TechNet\MSDN. I’ll be converting my test domain over the next few days and reporting on all the PowerShell goodies we get Technorati Tags...
Posted by RichardSiddaway | with no comments
Filed under:

Windows 7 and PowerGUI 1.9

Currently rebuilding the laptop.  Downloaded Windows 7 RTM from TechNet last night and did a complete refresh.  PowerGUI is one of the first installs on any new machine. The latest version installs great.  Notice the opportunity to prevent...
Posted by RichardSiddaway | with no comments
Filed under:

Service Startup History

If we need to look at the startup history of a service we can find the information in the event log 001 002 003 004 005 006 function Get-ServiceStartupHistory { param ( [string] $name ) Get-EventLog -LogName System | where { ( ( $_ . EventId -eq 7035...
More Posts Next page »