$MC = new-object system.management.ManagementClass win32_share
$MOC = $MC.GetInstances()
$MOC foreach {
$_.name
$null.name() = "Trap Me Please"
trap{"Trap";$null.name() = "Find Me Please"}
}
E$
Trapforeach-object : You cannot call a method on a null-valued expression.
At line:1 char:15
+ $MOC foreach <<<< {
October 2005 November 2005 December 2005 January 2006 February 2006 March 2006 April 2006 May 2006 June 2006 July 2006 August 2006 September 2006 October 2006 November 2006 December 2006