Powershell – Delete files older than x days

  ###FUNCTION TO DELETE OLD FILESfunction deleteOldFiles([int]$numberOfDays = $(throw "Specify the number of days")){$Now = Get-Date$TargetFolder = “C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup”$LastWrite = $Now.AddDays(-$numberOfDays)$Files = get-childitem $TargetFolder -include *.bak, *.x86 -recurse | Where {$_.LastWriteTime -le “$LastWrite”} foreach ($File in $Files){ write-host “Deleting File $File” -foregroundcolor “Red”; Remove-Item $File | out-null} }deleteOldFiles(3)

XAML in Visual Studio

The XAML previewer in Visual Studio is pretty bad and slow to load. You can get past this by setting XAML files to open by default in source code rather than the WPF Designer… Right click any XAML fileOpen With…choose Source Code (text) EditorClick the Set as Default buttonClick OK

Silverlight 3, Validation, MVVM, WCF and EF

All the current articles and tutorials on Silverlight 3 Validation show really simplistic examples, business objects in the UI space, no services etc etc My Problem When the business objects are being created and managed via the entity framework, there does not appear to be any simple ways of adding the validation properties to the... Continue Reading →

Updating Silverlight 2 solution to Silverlight 3

For my own reference these are the steps I took, and the problems I had. Naturally YMMV. Download the requisites from http://www.silverlight.net: Silverlight 3 Beta Tools for Visual StudioBlend 3 Preview Uninstall Silverlight 2 elements: Blend 2Silverlight ToolkitSilverlight ToolsSilverlight SDKSilverlight 2 Plugin Install the Silverlight 3 elements: Install Silverlight 3 ToolsInstall Blend 3 Preview Update... Continue Reading →

A WordPress.com Website.

Up ↑