<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://eggins.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Software Development</title><link>http://eggins.com/blogs/dev/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008 (Build: 30417.1769)</generator><item><title>Virtual machine problems and solutions</title><link>http://eggins.com/blogs/dev/archive/2008/04/08/virtual-machine-problems-and-solutions.aspx</link><pubDate>Tue, 08 Apr 2008 10:08:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:373</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=373</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2008/04/08/virtual-machine-problems-and-solutions.aspx#comments</comments><description>&lt;p&gt;Following on from my last post on &amp;quot;&lt;a href="http://eggins.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=11&amp;amp;postid=372"&gt;Reducing the footprint of your virtual Machines&lt;/a&gt;&amp;quot;, this post is about some general problems that I have come across while creating my virtual machines for software development. Like I said in my last post, I prefer to develop inside a VM, as this gives me the ability to develop inside a very clean environment with only the software required for developing software. I can create a VM for each of the .Net versions that I develop for.&lt;/p&gt;&lt;p&gt;I currently use &lt;a href="http://www.vmware.com/products/server/"&gt;VMWare Server&lt;/a&gt; 1.0.5 for my virtualisation needs. This is a free application.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So here are the problems and their solutions:&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; Windows XP by default takes up about 6GB of the available hard drive space even before the OS is installed. This bloats the size of the resulting VM considerably. The reason for the 6GB is that, assuming you give the VM 2GB or memory, XP will grab 2GB of hard drive space for the swap file, 2GB for the system restore area, and 2GB for a system hibernation area.&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Solution:&lt;/b&gt; There are ways to remove all three of these from XP after install (see &lt;a href="http://eggins.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=11&amp;amp;postid=372"&gt;Reducing the footprint of your virtual Machines&lt;/a&gt;). You could also install Windows Server 2003 or Windows Server 2008 instead. These server OS&amp;#39;s do not install the System Restore partition, nor the Hibernation area. Neither the System Restore partition, nor the Hibernation area are needed for my VM&amp;#39;s. I would suggest leaving the swap file as it is though. If you are developing web applications, you may also have the benefit of developing your software on the same OS that you will eventually migrate your code to. If you have an MSDN universal license, you are entitled to develop your software on the Windows Server 2008 that comes with your subscription.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; The VMWare UI is a little slow because it uses screen scraping to paint the UI&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt; Use VMWare to start the Virtual Machine, but use Terminal Services to RDP into the VM. Terminal Services uses a communication method that is much faster than screen scraping. If you do not want to start VMWare and start the virtual machine each time you use a VM, you can use a batch file with the following line to start the VM. Change the path after start to the path to your VMX file. If the virtual machine is already started, this does nothing.&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;quot;C:\Program Files\VMware\VMware VIX\vmrun.exe&amp;quot; start &amp;quot;c:\VirtualMachines\vs2008\vs2008.vmx&amp;quot;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; If you have multiple monitors, you may want the VM to span those monitors. &lt;br /&gt;&lt;font color="#000000"&gt;&lt;b&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#cc0000"&gt;&lt;font color="#000000"&gt;&lt;b&gt;Solution:&lt;/b&gt; Install Remote Desktop Connection (Terminal Services Client) 6.0. This is an option in the &lt;a href="http://update.microsoft.com"&gt;windows update&lt;/a&gt;, or you can get it from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=26F11F0C-0D18-4306-ABCF-D4F18C8F5DF9&amp;amp;displaylang=en"&gt;here&lt;/a&gt;. Then you either start mstsc.exe with the &amp;quot;/span&amp;quot; parameter, or alternatively, start mstsc.exe, type in your VM&amp;#39;s machine name, set any other settings you like, click the &amp;quot;Save As...&amp;quot; button, edit the resulting *.RDP file with notepad, and include the following line:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;span monitors:i:1&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; There is a bug in Windows Server 2003 SP2 that makes RDP sessions to that client which are larger than 1600x1200 to be forced to 8 bit colour. &lt;br /&gt;&lt;font color="#000000"&gt;&lt;b&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#cc0000"&gt;&lt;font color="#000000"&gt;&lt;b&gt;Solution:&lt;/b&gt; This is a known bug in Server 2003 SP2. Install the hotfix &amp;quot;&lt;a href="http://support.microsoft.com/kb/942610"&gt;KB942610&lt;/a&gt;&amp;quot; from Microsoft to fix this problem. This hotfix is only available from MS as a special request. They send you the link and password in email after you have requested it. This is because the hotfix has not been tested as rigorously as other freely available hotfixes.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt; &lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; When you open the Terminal Services Client with the span option, it does not know that you have two monitors. Therefore, maximising a window will maximise to both monitors, not the left or right, as is normally the case.&lt;br /&gt;&lt;/font&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Solution:&lt;/b&gt; Install &amp;quot;&lt;a href="http://reptils.free.fr/"&gt;WinSplit Revolition&lt;/a&gt;&amp;quot;, a freeware utility that allows the user to use Ctrl+Alt+Num-Pad keys to move windows around the screen. For example, Ctrl+Alt+4 maximises the window to the left screen, and Ctrl+Alt+6 maxmises the window to the right screen. Kudos to Raphael Lencrerot for this excelent application.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; The msi file for Visual Studio 2005 is a large installer, and when I ran it on Windows Server 2003, in the VM, with 1GB or memory allocated, it could not verify the msi as being error free. &lt;br /&gt;&lt;/font&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Solution:&lt;/b&gt; This is a known bug in Server 2003 SP2. Install the hotfix &amp;quot;&lt;a href="http://support.microsoft.com/kb/925336"&gt;KB925336&lt;/a&gt;&amp;quot; from Microsoft to fix this problem. This is a freely available hotfix.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; There was an application that I needed for development (MCMS) that requires the NetBIOS machine name to exactly match the DNS Machine Name. NetBIOS has a limit of 15 characters for the nachine name, while the DNS Machine Name has a much higher limit. When you set your DNS Machine Name to something over 15 characters, you will get a warning that the NetBIOS Machine Name will be truncated at 15 characters. This may not affect you with your applications, but it is something to consider.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt; To be safe, keep the machine name under 15 characters.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; Disk fragmentation. The VMWare image files reside on the host hard drive. If you did not consolidate your freespace using a defragmenter tool, these files may be fragmented. Fragmented VMWare image files will adversely affect the performance of the virtual machine. Also, as this image file is a virtual hard drive, the files within it can also become fragmented. Having a badly fragmented host drive and a badly fragmented guest VM drive will affect the overall performance of the Virtual machine dramatically.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt; I have found an application that can solve both of these fragmentation problems in one go. It is only required to install it on the host. It will defragment the host drive, and all VMWare guest files in all VMWare guests, in one action. The application is called &lt;a href="http://www.perfectdisk.com/home_office/home_perfectdisk_vmware.cfm"&gt;PerfectDisk&lt;/a&gt;. It is not cheap, but in my opinion, it is worth it for the extra speed.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; If you copy a VMWare image, and plan to use both the original and the copy at the same time, you may have some trouble with networking.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt; For a start, you should change the machine name. If you have set the original VM to have a fixed IP address, you will also have to change that IP address on the new clone. Beyond that, I would recommend at least running &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb897418.aspx"&gt;NewSID&lt;/a&gt;, which will change the Computer Security Identifier, and also has an option to change the machine name. This is the least invasive way to change the identity of a machine name. Alternatively, you can run the &lt;a href="http://support.microsoft.com/kb/302577"&gt;SysPrep&lt;/a&gt; tool from Microsoft. The SysPrep tool changes a LOT more items in the OS, so I would recommend having a copy of your VM before running SysPrep. Please read the instructions on the SysPrep page before running it on your VM. Also, read more about this topic from &lt;a href="http://www.microsoft.com/technet/prodtechnol/virtualserver/2005/proddocs/vs_operate_using_VMRC_copyVM.mspx?mfr=true"&gt;Microsoft TechNet&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; Windows Server 2003 and 2008 both allow two logon&amp;#39;s by Terminal Services, and one at the console. If you use the Terminal Services Client to connect to a &lt;/font&gt;&lt;font color="#cc0000"&gt;Windows Server 2003 VM, it will not connect to the console by default, but to one of the available Terminal Services Sessions. If you were connected to the console via the VMWare interface, you now have two logins to the same machine. If you then connect again with another Terminal Services Client, you will have three concurrent logins to the same machine, potentially all with the same userid. This is not useful in my case, and I always just want to log in to the console itself, so that I can easily swap between the VMware interface and the Terminal Services Client inteerface.&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#cc0000"&gt;&lt;/font&gt;&lt;b&gt;Solution:&lt;/b&gt; I edited the RDP files with notepad and added the following line below. This makes the connection to the console. If you want to connect using one of the two available Terminal Services connections in Windows Server 2003, you can create another RDP file without this line, or just use the Remote Desktop Connection link in your Start menu. Please note that Server 2008 behaves differently, and does not seem to require this setting. If you log onto a Server 2008 VM using the VMWare Interface, and then log into that same VM with the same credentials using Terminal Services Client, you will be handed the initial login from within the VMWare interface, even without the following line.&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;connect to console:i:1&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;Problem:&lt;/b&gt; Windows Server 2003 and 2008 do not allow you to shut down the server without first logging on. This can be an issue if you start the wrong VM, or if you accidentally log off the VM using RDP instead of shutting down, and then want to use the VMWare iterface to shut down the VM without waiting for the logon and logoff process.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt; Start &amp;gt; Run &amp;gt; gpedit.msc. Browse to: &amp;quot;Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\&amp;quot;. Double Click &amp;quot;Shutdown: Allow system to be shut down without having to log on&amp;quot;. Set to Enabled. Now the &amp;quot;Shutdown…&amp;quot; button will be allowed in the login form. &lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=373" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/virtualmachine+virtualisation/default.aspx">virtualmachine virtualisation</category></item><item><title>Reduce the footprint of your virtual machines</title><link>http://eggins.com/blogs/dev/archive/2008/03/04/reduce-the-size-of-your-virtual-machines.aspx</link><pubDate>Tue, 04 Mar 2008 10:13:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:372</guid><dc:creator>David</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=372</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2008/03/04/reduce-the-size-of-your-virtual-machines.aspx#comments</comments><description>&lt;p&gt;I find that using virtual machines (VM) for my development environment keeps the development environment clean of any unnecessary installers, and allows me to have various development environments ready to go. For example, I have a VM for .Net 1.1, a VM for .Net 2.0, a VM for .Net 3.0, and a VM for .Net 3.5. Then I use some VM&amp;#39;s for testing different web applications side by side that use different versions of the .Net framework.&lt;br /&gt;&lt;br /&gt;One of the major issues with having all of these VM&amp;#39;s is that they take up a lot of hard drive space. You cannot do much with the size of the OS install, or the footprint of the applications you choose to install. One thing to note here though is that the 64 bit Windows OS versions are about twice the install size of the 32 bit versions. If you do not actually need to test against the 64 Bit versions, then use the 32 bit OS versions.&lt;br /&gt;&lt;br /&gt;So, where can you look to squeeze down the size of the files for your VM&amp;#39;s? I have found three places that can make a considerable space saving. All up, on my configuration, performing the three steps below saves me around 6 GB. This is a big difference when trying to fit VM&amp;#39;s onto a laptop, and when taking backups of your VM files.&lt;br /&gt;&lt;br /&gt;&lt;font style="FONT-WEIGHT:bold;" color="#0000cc"&gt;1) Turn off Windows hibernation&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;By default, Windows XP installs with the Hibernate option set to on. This means that you can hibernate the PC, which places all of the memory onto the hard drive, in a file called c:\Hiberfil.sys. This file is created at the same size as your memory, and is pre-allocated, meaning it is there, even if you have never hibernated the system. For a developer, turning off the hibernate option will save from 1GB to 2GB, which is the typical amount of memory you would allocate to your VM. So far as I can tell, Windows Server 2003 has this feature turned off by default, but it is worth a check.&lt;br /&gt;&lt;br /&gt;&lt;font style="FONT-WEIGHT:bold;" color="#009900"&gt;Instructions to turn off windows hibernation&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the Windows Control Panel&lt;/li&gt;
&lt;li&gt;Double-click Power Options &lt;/li&gt;
&lt;li&gt;Click the Hibernate tab, de-select the &amp;#39;Enable hibernate support&amp;#39; check box, and then click Apply. &lt;/li&gt;
&lt;li&gt;Restart your computer and hiberfil.sys will be automatically deleted. &lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: If you decide to turn the hibernation feature back on in the future, go to the Windows Help &amp;amp; Support Center and search for &amp;#39;enable hibernation&amp;#39;. It should be the first result. The instructions detail some other steps you may need to follow to reactivate the hibernation. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT:bold;"&gt;2) Turn of Windows System Restore&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;By default, Windows XP has System Restore turned on. This pre-allocates an amount of space on your HDD for storing restore points for the OS. Each time you make critical changes to the OS, it saves restore points so that you can undo the change if it all goes wrong. On my PC, the space taken up by this System Restore feature was 2GB.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT:bold;"&gt;Instructions to turn off system restore to save the system restore space&lt;/span&gt;&lt;br style="FONT-WEIGHT:bold;" /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Right click My Computer&lt;/li&gt;
&lt;li&gt;Properties&lt;/li&gt;
&lt;li&gt;System Restore tab&lt;/li&gt;
&lt;li&gt;Un-tick &amp;quot;Turn off System Restore on all drives&amp;quot;&lt;/li&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;li&gt;Reboot the computer&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT:bold;"&gt;3) Remove or resize the Windows paging file&lt;/span&gt;&lt;br style="FONT-WEIGHT:bold;" /&gt;&lt;/p&gt;
&lt;p&gt;Now every developer should know what the paging file is, so I will not go into explaining what it is used for. Removing the paging file might be a little drastic, but depending on the amount of memory you allocate to your VM, you could at least reduce the size of the paging file, and minimize the pre-allocation, but let it grow if necessary. This will slow down the VM considerably if you ever get one of your applications run away and use up all of your physical memory. I will show below how to eliminate the use of the paging file, and also how to clean it out, but let it grow.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT:bold;"&gt;Instructions to remove the windows paging file&lt;/span&gt;&lt;br style="FONT-WEIGHT:bold;" /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Right click My Computer&lt;/li&gt;
&lt;li&gt;Properties&lt;/li&gt;
&lt;li&gt;Advanced tab&lt;/li&gt;
&lt;li&gt;Performance&amp;nbsp; - Settings&lt;/li&gt;
&lt;li&gt;Advanced tab&lt;/li&gt;
&lt;li&gt;Virtual Memory - Change&lt;/li&gt;
&lt;li&gt;One by one, select each drive, select No paging file, and click Set&lt;/li&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;li&gt;Reboot the computer&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT:bold;"&gt;Instructions to reduce the size of the paging file&lt;/span&gt;&lt;br style="FONT-WEIGHT:bold;" /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the instructions above to remove the paging file, including the reboot&lt;/li&gt;
&lt;li&gt;Right click My Computer&lt;/li&gt;
&lt;li&gt;Properties&lt;/li&gt;
&lt;li&gt;Advanced tab&lt;/li&gt;
&lt;li&gt;Performance&amp;nbsp; - Settings&lt;/li&gt;
&lt;li&gt;Advanced tab&lt;/li&gt;
&lt;li&gt;Virtual Memory - Change&lt;/li&gt;
&lt;li&gt;Select the drive you want to put the paging file onto&lt;/li&gt;
&lt;li&gt;Select the Custom size option&lt;/li&gt;
&lt;li&gt;Set an initial size of whatever you can spare. This can be as low as 2 MB&lt;/li&gt;
&lt;li&gt;Set the Maximum size to the limit you want it to grow to. This stops it running away and claiming all of your HDD free space.&lt;/li&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;li&gt;Reboot the computer&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=372" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/virtualmachine/default.aspx">virtualmachine</category></item><item><title>Add event source using Powershell</title><link>http://eggins.com/blogs/dev/archive/2008/02/16/add-event-source-using-powershell.aspx</link><pubDate>Sat, 16 Feb 2008 11:29:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:371</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=371</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2008/02/16/add-event-source-using-powershell.aspx#comments</comments><description>&lt;p&gt;If you write to the event log from an ASP.Net application, the default ASPNET account will not have the correct privileges to add your event source. You have to add the event source outside of the ASP.Net application. I used to use a C# console application that I wrote for the purpose of registering my ASP.Net application event sources. Now that I have Powershell on all of the computers I work on, I would rather do this from within Powershell.&lt;/p&gt;&lt;p&gt;At the simplest, this will work:&lt;/p&gt;&lt;p&gt;&lt;font color="#000099" face="courier new,courier"&gt;[System.Diagnostics.EventLog]::CreateEventSource(&amp;quot;MySourceName&amp;quot;, &amp;quot;Application&amp;quot;)&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;But the following function will check if the event source is already registered before registering the name.&lt;br /&gt;&amp;nbsp;&lt;font color="#000099" face="courier new,courier"&gt;&lt;br /&gt;Function RegisterEventSource ([String]$sourceName, [string]$eventLogName = &amp;quot;Application&amp;quot;) {&lt;br /&gt;&amp;nbsp; if ([System.Diagnostics.EventLog]::SourceExists($sourceName) -eq $False) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.EventLog]::CreateEventSource($sourceName, $eventLogName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;The event source &amp;#39;$sourceName&amp;#39; has been added to the &amp;#39;$eventLogName&amp;#39; event log.&amp;quot;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;The event source &amp;#39;$sourceName&amp;#39; already existed&amp;quot;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;So now all you need is Powershell, and all developers have Powershell installed don&amp;#39;t they? :-)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=371" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/event/default.aspx">event</category></item><item><title>IIS ASP.Net version switcher</title><link>http://eggins.com/blogs/dev/archive/2008/02/06/iis-asp-net-version-switcher.aspx</link><pubDate>Tue, 05 Feb 2008 17:21:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:370</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=370</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2008/02/06/iis-asp-net-version-switcher.aspx#comments</comments><description>&lt;p&gt;OK, it seems like it is getting harder to get the ASP.Net tab to show up in IIS. I now have a machine with .Net 1.1, 2.0, 3.0, and 3.5 installed. No matter what I do, the ASP.Net tab will not show. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;But all is well, as there is a very cool tool created by Denis Bauer (no relation to my wife) that will allow you to view and change the version of ASP.Net that is associated with an IIS web site. Download it from the link below.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.denisbauer.com/NETTools/ASPNETVersionSwitcher.aspx" title="ASP.Net version switcher"&gt;http://www.denisbauer.com/NETTools/ASPNETVersionSwitcher.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=370" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/iis/default.aspx">iis</category><category domain="http://eggins.com/blogs/dev/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://eggins.com/blogs/dev/archive/tags/version/default.aspx">version</category></item><item><title>ASP.Net tab not showing up in IIS</title><link>http://eggins.com/blogs/dev/archive/2007/11/12/asp-net-tab-not-showing-up-in-iis.aspx</link><pubDate>Mon, 12 Nov 2007 03:07:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:368</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=368</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/11/12/asp-net-tab-not-showing-up-in-iis.aspx#comments</comments><description>&lt;p&gt;The ASP.Net tab recently disappeared from our server running Windows Server 2003 SP2 (32 bit). It had .Net 1.0, .Net 1.1, .Net 2.0, and .Net 3.0 installed.&lt;/p&gt;&lt;p&gt;In order to get the tab to show again, I:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Uninstalled IIS (and ASP.Net when prompted)&lt;/li&gt;&lt;li&gt;Rebooted the server&lt;/li&gt;&lt;li&gt;Re-Installed IIS (with Frontpage Server Extensions, and the SMTP server)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt; This did the trick, and the ASP.Net tab is back in IIS. I have no idea what caused this, and hopefully it will never happen again.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=368" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/iis/default.aspx">iis</category><category domain="http://eggins.com/blogs/dev/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://eggins.com/blogs/dev/archive/tags/dotnet/default.aspx">dotnet</category></item><item><title>Converting the results of a Cmdlet to a formatted string</title><link>http://eggins.com/blogs/dev/archive/2007/08/17/converting-the-results-of-a-cmdlet-to-a-formatted-string.aspx</link><pubDate>Fri, 17 Aug 2007 02:00:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:293</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=293</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/08/17/converting-the-results-of-a-cmdlet-to-a-formatted-string.aspx#comments</comments><description>&lt;p&gt;There are times that you may want to store the results of a Cmdlet as a string instead of the usual collection of objects. This is handy to create a textual report.&lt;/p&gt;&lt;p&gt;The following command stores the contents of C:\Windows into a varialble.&lt;br /&gt;&amp;nbsp; &lt;font color="#0000cc" face="courier new,courier"&gt;$Result = dir c:\windows&lt;/font&gt;&lt;/p&gt;&lt;p&gt;The $Result variable is a collection of System.IO.DirectoryInfo and System.IO.FileInfo objects as you will see by executing:&lt;br /&gt;&amp;nbsp; &lt;font color="#0000cc" face="courier new,courier"&gt;$Result | Get-Member&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Now if you try the following command, which tries to send that result to an email address using the Powershell Comunity Extensions Send-SmptEmail Cmdlet, this command does not work:&lt;br /&gt;&amp;nbsp;&lt;font color="#0000cc" face="courier new,courier"&gt;send-smtpmail -smtpHost localhost -to receiver@abc123.com -from sender@abc123.com -Subject &amp;quot;Directory&amp;quot; -body $Report&lt;/font&gt;&lt;/p&gt;&lt;p&gt;It crashes with the Message:&lt;br /&gt;&amp;nbsp; &lt;font color="#990000"&gt;Send-SmtpMail : Cannot convert &amp;#39;System.Object[]&amp;#39; to the type &amp;#39;System.String&amp;#39; required by parameter &amp;#39;Body&amp;#39;. Specified method is not supported.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;How do you convert the $Result variable to a string? The following command converts it to a string.&lt;br /&gt;&amp;nbsp; &lt;font color="#0000cc" face="courier new,courier"&gt;$Report | Out-String&lt;/font&gt; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;So you can now email the results using:&lt;br /&gt;&amp;nbsp; &lt;font color="#0000cc" face="courier new,courier"&gt;send-smtpmail -smtpHost localhost -to receiver@abc123.com -from sender@abc123.com -Subject &amp;quot;Directory&amp;quot; -body $($Report | Out-String)&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You will get the string result in the same format as is displayed to you on the screen when you execute&lt;br /&gt;&lt;font color="#0000cc" face="courier new,courier"&gt;&amp;nbsp; Dir C:\Windows&lt;/font&gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=293" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/string/default.aspx">string</category><category domain="http://eggins.com/blogs/dev/archive/tags/convert/default.aspx">convert</category></item><item><title>Switching between TFS and Sourcesafe as your sourcecode control</title><link>http://eggins.com/blogs/dev/archive/2007/06/14/switching-between-tfs-and-sourcesafe-as-your-sourcecode-control.aspx</link><pubDate>Thu, 14 Jun 2007 02:40:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:179</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=179</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/06/14/switching-between-tfs-and-sourcesafe-as-your-sourcecode-control.aspx#comments</comments><description>&lt;p&gt;So you have installed VS 2005 on your workstation, and Team Foundation Server (TFS) on your server You are developing all of your new applications using .Net 3.0, VS 2005. You are managing the projects using TFS for workitems, and your sourcecode control.&lt;/p&gt;&lt;p&gt;But what about your legacy applications? It would be nice to be able to use TFS as the sourcecode control for your .Net 1.1 applications developed using VS.Net 2003. This is possible after you install the (MS SourceCode Control Integration) MSSCCI provider. This tool changes your default sourcecode control provider to TFS, and installs the necessary compnents to connect VS.Net 2003 to the TFS courcecode control. the MSSCCI provider can be downloaded from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=87E1FFBD-A484-4C3A-8776-D560AB1E6198&amp;amp;displaylang=en" title="MSSCCI provider"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This is all fine if you are ready to make a clean break for it and move all of your legacy applications to TFS sourcecode control at once. But this is not always possible. At this point, you will have no easy way to return to using Sourcesafe as your sourcecode control in your VS.Net 2003 IDE. It should be noted that the MSSCCI provider has no impact on the VS 2005 IDE.&lt;/p&gt;&lt;p&gt;You can download and install the &lt;a href="http://www.codeproject.com/tools/sccswitcher.asp" title=" Sourcecode Control Switcher"&gt;Sourcecode Control Stwitcher&lt;/a&gt; (SCC) to allow switching between Sourcesafe, and TFS as your sourcecode control. This tool installs itself into the system tray. You switch between providers using the pop up menu. I would recommend selecting the Autostart option after install by clicking on the SCC icon in the system tray, and clicking the Autostart option so that it is ticked. This will save you having to run the SCC tool each time you restart your workstation.&lt;/p&gt;&lt;p&gt;Bear in mind that this setting is a machine wide setting. You cannot have one instance of VS.Net 2003 pointed to TFS and another instance of VS.Net 2003. pointed to Sourcesafe. You will have to use SCC to select the sourcecode control provider of your choice, and then start VS.Net 2003. &lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=179" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/tool/default.aspx">tool</category><category domain="http://eggins.com/blogs/dev/archive/tags/dotnet/default.aspx">dotnet</category><category domain="http://eggins.com/blogs/dev/archive/tags/tfs/default.aspx">tfs</category><category domain="http://eggins.com/blogs/dev/archive/tags/vsts/default.aspx">vsts</category><category domain="http://eggins.com/blogs/dev/archive/tags/tips/default.aspx">tips</category><category domain="http://eggins.com/blogs/dev/archive/tags/vs.net+2003/default.aspx">vs.net 2003</category><category domain="http://eggins.com/blogs/dev/archive/tags/sourcesafe/default.aspx">sourcesafe</category><category domain="http://eggins.com/blogs/dev/archive/tags/source+control/default.aspx">source control</category><category domain="http://eggins.com/blogs/dev/archive/tags/msscci/default.aspx">msscci</category></item><item><title>Powershell function to split SQL Server stored procedure script file</title><link>http://eggins.com/blogs/dev/archive/2007/06/01/powershell-function-to-split-sql-server-stored-procedure-sctipt-file.aspx</link><pubDate>Fri, 01 Jun 2007 05:34:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:152</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=152</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/06/01/powershell-function-to-split-sql-server-stored-procedure-sctipt-file.aspx#comments</comments><description>&lt;p&gt;We do not yet have a good way to compare our Test and Production databases. This will be changing very soon. In the meantime, I have written the script below that may be of use for others without database compare tools.&lt;/p&gt;&lt;p&gt;You can script all of the stored procedures in a SQL Server 2005 database to a &amp;quot;.sql&amp;quot; file. The order of these stored procedures tends to be a little random, and therefore makes comparing two of these files impossible. The script below splits each stored procedure script into its own file so that you can use a directory compare tool to compare the files and see what changed.&lt;/p&gt;&lt;p&gt;It is not exactly the most readable powershell script, but it it works (for me). :-)&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="courier new,courier" size="2"&gt;Function Split-StoredProcedures ([string]$scriptedSpsFile) {&lt;br /&gt;&amp;nbsp; ## This function takes a path to a file containing stored&lt;br /&gt;&amp;nbsp; ## procedures, scripted from SQL Server 2005.&lt;br /&gt;&amp;nbsp; ## It then splits all of the stored procedures into their&lt;br /&gt;&amp;nbsp; ## own files. These files can then be compared to another&lt;br /&gt;&amp;nbsp; ## set of scripted SP&amp;#39;s using something &lt;br /&gt;&amp;nbsp; ## like &amp;quot;Directory Toolkit&amp;quot; from &amp;quot;www.funduc.com&amp;quot;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; # Delete the output folder if it already exists,&lt;br /&gt;&amp;nbsp; # and create the output folder&lt;br /&gt;&amp;nbsp; [string]$OutputFolder = $scriptedSpsFile + &amp;quot;.Split&amp;quot;&lt;br /&gt;&amp;nbsp; if (Test-Path $OutputFolder) {rd $OutputFolder -recurse}&lt;br /&gt;&amp;nbsp; $null = md $OutputFolder&lt;br /&gt;&lt;br /&gt;&amp;nbsp; # Get the content of the file at the path passed in by the user&lt;br /&gt;&amp;nbsp; get-content -path $ScriptedSpsFile | &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Locate the first line of a SP creation script&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($_.ToUpper() -eq &amp;quot;SET ANSI_NULLS ON&amp;quot; -and $FileName -ne $Null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the file for the previous SP&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FileName += &amp;quot;.txt&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $OutputFile = Join-Path -path $OutputFolder -childPath $FileName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set-Content -path $OutputFile -value $Cache&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Cache = $Null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FileName = $Null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get the name of the SP, and put it in the FileName variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($_.ToUpper() -like &amp;quot;CREATE PROCEDURE*&amp;quot;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FileName =&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([RegEx]::Matches($_, &amp;#39;\[dbo].\[(?&amp;lt;SpName&amp;gt;sp_.*)\]&amp;#39;))[0].Groups[1].Value&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Write the line to the cache for this SP&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Cache += $_ + &amp;quot;`r`n&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/font&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=152" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/sql+server/default.aspx">sql server</category><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/sql/default.aspx">sql</category></item><item><title>Powershell one liner to see the progress of an install</title><link>http://eggins.com/blogs/dev/archive/2007/05/31/powershell-one-liner-to-see-the-progress-of-an-install.aspx</link><pubDate>Thu, 31 May 2007 08:46:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:140</guid><dc:creator>David</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=140</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/31/powershell-one-liner-to-see-the-progress-of-an-install.aspx#comments</comments><description>&lt;p&gt;So I am installing the Visual Studio 2005 SP1, which takes up to several hours according to one of the early installer screens. I have had to install VS 2005 SP1 on several machines, and it has been known to become unresponsive during the install, requiring teh process to be killed.&lt;/p&gt;&lt;p&gt;While waiting for the next installer window requiring a response from me, I was thinking that the installer should be giving me more feedback as to what it is doing. Then I thought powershell could help! It always can :-)&lt;/p&gt;&lt;p&gt;So this is the one liner I came up with:&lt;br /&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;While ($True) {cls;Get-Process |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where {$_.processname -eq &amp;quot;msiexec&amp;quot; -or $_.processname -like &amp;quot;vs*&amp;quot;} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Format-Table;[System.Threading.Thread]::Sleep(1000)}&lt;/font&gt; &lt;/p&gt;&lt;p&gt;I have split it over several lines here to fit it in the blog width. Basically, it loops forever, clearing the screen, getting the running processes, filters that to just those named &amp;quot;msiexec&amp;quot; or starting with &amp;quot;vs&amp;quot;, displaying&amp;nbsp; them as a table, sleeping for 1 secong, and then repeating. &lt;/p&gt;&lt;p&gt;Now I can see the total processor time and memory usage of the installer(s), second by second, and while it is changing, I know that the installer is doing something.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;If you like, you can perform a Get-Member on the Get-Process cmdlet to list all of the available properties:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; Get-Process | Get-Member -memberType Property, ScriptProperty, AliasProperty&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;and decide which properties you want to keep an eye on. For example:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;While ($True) {cls;Get-Process |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where {$_.processname -eq &amp;quot;msiexec&amp;quot; -or $_.processname -like &amp;quot;vs*&amp;quot;} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Format-Table CPU, PM, VM, WS;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Threading.Thread]::Sleep(1000)}&lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;And lastly, the short form version of this is:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; While($True){cls;ps|?{$_.processname -eq &amp;quot;msiexec&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -or $_.processname -like &amp;quot;a*&amp;quot;}|ft;[Threading.Thread]::Sleep(1000)}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;It is probably obvious, but if you run this and see a blank screen, it is because you have no patching process names. Change the process name matches.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=140" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Team Explorer</title><link>http://eggins.com/blogs/dev/archive/2007/05/31/team-explorer.aspx</link><pubDate>Thu, 31 May 2007 03:31:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:139</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=139</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/31/team-explorer.aspx#comments</comments><description>&lt;p&gt;I have been doing a bit of reasearch on Team Explorer. In the early beta vesions of VS.Net 2005, they iincluded Team Explorer in the VS 2005 install. When it became apparent that Team Foundation Server (TFS) was not going to be ready for release by the VS 2005 release date, they removed Team Explorer from the VS 2005 install.&lt;/p&gt;&lt;p&gt;This is why you cannot connect to Team Foundation Server when you first install VS 2005. You must first install Team Explorer from the &amp;quot;tfc&amp;quot; folder on the Team Foundation Server install DVD. The folder is called &amp;quot;tfc&amp;quot; because Team Explorer was initally called Team Foundation Client.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You can install Team Explorer without VS 2005, in which case the installer will install a Team Explorer client UI. If you have already installed VS 2005, Team Explorer will integrate itself into Visual Studio 2005, and you will not get a separate Team Explorer client UI.&lt;/p&gt;&lt;p&gt;Team Explorer allows you to create, read, update, and delete items in the TFS source control and the TFS Work Items store, along with other TFS Project items.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=139" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Quick and easy way to measure the length of a string</title><link>http://eggins.com/blogs/dev/archive/2007/05/31/quick-and-easy-way-to-measure-the-length-of-a-string.aspx</link><pubDate>Thu, 31 May 2007 00:59:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:138</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=138</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/31/quick-and-easy-way-to-measure-the-length-of-a-string.aspx#comments</comments><description>&lt;p&gt;If you want to quickly measure the length of a string, you can use Powershell. Just enclose the string in quotes and call the Length property.&lt;/p&gt;&lt;p&gt;For example:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;&lt;font face="courier new,courier"&gt;&amp;quot;The quick brown fox jumped over the lazy dog&amp;quot;.length&lt;br /&gt;&amp;nbsp; &amp;quot;C:\Documents and Settings\All Users\Start Menu&amp;quot;.length&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#000000"&gt;Even better, if you have copied a multi line string into the clipboard, you can still use powershell to measure the length of that string.&lt;/font&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Copy your multi line string to the clipboard&lt;/li&gt;&lt;li&gt;Open Powershell&lt;/li&gt;&lt;li&gt;Type the double quote char to open a string&lt;/li&gt;&lt;li&gt;Tap the right mouse button&lt;/li&gt;&lt;li&gt;Close the string with the double quote char, and follow that with a &amp;quot;.length&amp;quot;&lt;/li&gt;&lt;/ul&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; 01# &amp;quot;123&lt;br /&gt;&amp;nbsp; &amp;gt;&amp;gt; 456&lt;br /&gt;&amp;nbsp; &amp;gt;&amp;gt; 789&amp;quot;.length&lt;br /&gt;&amp;nbsp; &amp;gt;&amp;gt;&lt;br /&gt;&amp;nbsp; 11&lt;/font&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#000000"&gt;So this shows that the length of the above string is 11 chars. This is because the string was copied into the Powershell command line, and powershell uses just a line feed character for next-line. If you copied the string from an editor that uses a carriage return and a line feed to mark a new line, then &lt;font color="#ff0000"&gt;the length reported here will be wrong&lt;/font&gt;. I would therefore recommend you do not use the above method. A better method follows.&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Lastly, the easiest way of all is to copy your string to the clipboard, open powershell and type:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;&lt;font face="courier new,courier"&gt;{Get-Clipboard).Length&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;You must enclose Get-Clipboard in the parentheses, as the Get-Clipboard cmdlet does not have a .Length property. The perentheses tells Powershell to execute the Get-ClipBoard function, and then get the value of the &amp;quot;length&amp;quot; property on the returned value (which is a string). &lt;/p&gt;&lt;p&gt;Importantly, you will notice that this function returns 13. This is because the Get-Clipboard returns the actual string in the clipboard, which in my case was a string copied out of Notepad, which uses carriage return and line feed characters to mark the end of each line.&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=138" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Count the number of properties, methods, events, etc on all types in all assemblies loaded into Powershell</title><link>http://eggins.com/blogs/dev/archive/2007/05/30/count-the-number-of-properties-methods-and-events-on-all-types-available-to-powershell.aspx</link><pubDate>Wed, 30 May 2007 11:20:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:123</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=123</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/30/count-the-number-of-properties-methods-and-events-on-all-types-available-to-powershell.aspx#comments</comments><description>&lt;p&gt;While writing my earlier blogs on loading assemblies and finding types, I was playing around with the functions that allow me to count the total available members on all types in all loaded assembles. This may not be of great use, but it is interesting nonetheless.&lt;/p&gt;&lt;p&gt;So this command will show the total number of members&amp;nbsp; (properties, methods, events, etc) that are available on all of the assemblies loaded into Powershell.&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; &lt;span style="font-family:courier new,courier;"&gt;([Threading.Thread]::GetDomain().GetAssemblies() |&lt;br /&gt;&amp;nbsp; &amp;nbsp; Foreach-Object {$_.GetTypes()} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-object {$_.GetMembers()}).Count&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;In my case there are 164,697.&lt;/p&gt;&lt;p&gt;And this command will show the total number of methods that are available on all of the assemblies loaded into Powershell.&lt;br /&gt;
&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; &lt;span style="font-family:courier new,courier;"&gt;([Threading.Thread]::GetDomain().GetAssemblies() |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.GetTypes()} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.GetMembers()}).Count&lt;/span&gt; &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;In my case there are 116,574.&lt;/p&gt;&lt;p&gt;And If I run my commands from &lt;a href="http://eggins.com/blogs/dev/archive/2007/05/28/load-an-assembly-in-powershell.aspx" title="Load an assembly in powershell pt 1"&gt;here&lt;/a&gt; which loads all of the assemblies in the GAC, and run the GetMembers command above, I now have a total of 545,413 members!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Hmm, I wonder if I can commit them all to memory before my next interview &lt;img src="http://eggins.com/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=123" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Find paths longer than a given number of characters</title><link>http://eggins.com/blogs/dev/archive/2007/05/30/find-paths-longet-than-a-given-number-of-characters.aspx</link><pubDate>Wed, 30 May 2007 10:38:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:124</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=124</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/30/find-paths-longet-than-a-given-number-of-characters.aspx#comments</comments><description>&lt;p&gt;There are times where you may need to list the paths to files and folders which exceed a given number of characters. FAT, NTFS, CDFS, ISO DVD, FATX, and Novell Netware all have different limitations on the length of a path. It is helpful to know the paths that will exceed these limits when copying from one system to the other.&lt;/p&gt;&lt;p&gt;I have written a Powershell function below that will scan a path recursively for path lengths that are longer than a user specified length. All paths that exceed that length are written to the screen and to a file. The user can specify the file, and can also let the function know if that file should be overwritten or concatenaed with the new scan data.&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; Function Find-LongPaths ([string]$path = &amp;quot;C:\&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , [int]$maxLength = 255 `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , [string]$outputFile = &amp;quot;C:\LongPaths.txt&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , [bool]$concatenateOutput = $False) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($concatenateOutput -eq $False `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -and (Test-Path $outputFile) -eq $True) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove-Item $outputFile&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ofs = &amp;quot;&amp;quot; # By default, the output format separator is a single space, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # and all string concatenations get this space between them!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string[]]$PathsOverMaxLen = $null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [int]$PathsProcessed = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [int]$PathsOverLength = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cls&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0..7 | %{Write-Host &amp;quot; &amp;quot;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;Paths over $maxLength chars long&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;=============================&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot; &amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;Len Path&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;--- -------------------------&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dir -path $path -recurse |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($_.FullName.Length -gt $maxLength) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $PathsOverLength++&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host $_.FullName.Length.ToString().PadLeft(3, &amp;quot; &amp;quot;) $_.FullName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $PathsOverMaxLen += $_.FullName.Trim() + &amp;quot;`r`n&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $PathsProcessed++&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($PathsProcessed % 250 -eq 0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Progress `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -activity &amp;quot;Finding paths in $path over $maxLength chars&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Status &amp;quot;Processed $PathsProcessed paths&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -curr &amp;quot;Paths over $maxLength chars in length = $PathsOverLength&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string]$FileContent = &amp;quot;`r`n`r`n&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + [System.DateTime]::Now.ToString() `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &amp;quot;`r`n&amp;quot; + $PathsOverMaxLen&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FileContent &amp;gt;&amp;gt; $outputFile&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot; &amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;Output written to $outputFile&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot; &amp;quot;&lt;br /&gt;&amp;nbsp; } &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Please be aware that I have split a lot of the code lines above onto multiple lines using the tilde &amp;quot;`&amp;quot; Powershell line continuation character. This is only for the purpose of fitting the code within the available width of this blog. You may remove them if you like.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;As you can see, all arguments have default values, or you can specify your own values when executing the function.&amp;nbsp;&lt;/p&gt;&lt;p&gt;The function uses the Write-Progress cmdlet in Powershell so that you can get an idea of the progress of a large scan. If it is a very quick scan, this progress display may not appear.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=124" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Powershell function to locate a type</title><link>http://eggins.com/blogs/dev/archive/2007/05/29/powershell-function-to-locate-a-type.aspx</link><pubDate>Tue, 29 May 2007 13:17:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:122</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=122</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/29/powershell-function-to-locate-a-type.aspx#comments</comments><description>&lt;p&gt;My earlier posts on loading assemblies into Powershell gave me an idea for a useful Powershell function. I cannot remember the namespace for every type in the .Net framework, and all of our own custom business types. I have always wanted to have the functionality to locate a type, and get the namespace where it resides. We can write a Powershell cmdlet to do just that. I have listed out the full discovery path to create this function. If you just want to skip to the function, it is at the bottom of this blog post.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So we already know that we can get a list of loaded assemlies using the command&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$LoadedAssemblies = [System.Threading.Thread]::GetDomain().GetAssemblies()&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Then we can look at the available members on these &amp;quot;Assembly&amp;quot; objects using the following command line&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$LoadedAssemblies | gm&lt;/font&gt;&lt;/p&gt;&lt;p&gt;You will notice that there is a &amp;quot;GetTypes&amp;quot; function. This is just what wee need. So the following command will list every type within every assembly currently loaded into Powershell&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$LoadedAssemblies | foreach-object {$_.GetTypes()}&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;And the following command tells me that there are currently 8285 types within the default assemblies loaded into Powershell 1.0 after installing Powershell Community Extensions. No wonder I cannot remember which namespace that type resides in! :-)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$LoadedAssemblies |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.GetTypes()} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$Count++}; $Count&lt;/font&gt; &lt;/p&gt;&lt;p&gt;So lets add a filter to just show the types containing a particular set of characters. In this case, I will look for any types that contain the letters &amp;quot;ftp&amp;quot;.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$LoadedAssemblies |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.GetTypes()} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where-Object {$_.Name -like &amp;quot;*ftp*&amp;quot;}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Not bad. Now lets format the results so that they can be used as a using statement within a c# app. We will also keep the fullname so you can chose which using statement to grab, based on the type you are after.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$LoadedAssemblies |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.GetTypes()} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where-Object {$_.Name -like &amp;quot;*ftp*&amp;quot;} | &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Format-Table FullName, @{Label = &amp;quot;Using Statement&amp;quot;; Expression={&amp;quot;using &amp;quot; + $_.Namespace}}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;This is the result of running the command above.&lt;br /&gt;&lt;font color="#660000" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FullName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Using Statement&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.FtpStyleUriParser&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpStatusCode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.WebRequestMethods+Ftp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpOperation&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpMethodFlags&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpMethodInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpWebRequest&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpWebRequestCreator&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpWebResponse&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpPrimitive&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpLoginState&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpControlStream&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.FtpDataStream&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.Cache.FtpRequestCacheValidator&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Net.Cache&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Net.Configuration.FtpCachePolicyElement&amp;nbsp;&amp;nbsp; using System.Net.Configuration&lt;/font&gt;&amp;nbsp; &lt;/p&gt;&lt;p&gt;Now lets make this into a nice neat function.&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function Find-Type ([string]$FindString) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; [System.Threading.Thread]::GetDomain().GetAssemblies() |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.GetTypes()} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where-Object {$_.Name -like &amp;quot;*${FindString}*&amp;quot;} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Format-table FullName, @{Label = &amp;quot;UsingStatement&amp;quot;; Expression={&amp;quot;using &amp;quot; + $_.Namespace}}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;You will need to put this function inside your profile file, or a ps1 file dot-sourced from your profile file so that you can run the function from the Powershell command line. You may even look at creating an alias to shorten the function name.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The last piece of the puzzle is to load all of your own custom assemblies into powershell before calling this function so that you can find types within your own custom assemblies. I shall leave that task to you.&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=122" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title> Load an assembly in Powershell Pt 2</title><link>http://eggins.com/blogs/dev/archive/2007/05/29/load-an-assembly-in-powershell-pt-2.aspx</link><pubDate>Tue, 29 May 2007 11:58:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:121</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=121</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/29/load-an-assembly-in-powershell-pt-2.aspx#comments</comments><description>&lt;p&gt;Yesterday I posted on adding an assembly to Powershell. You should be aware that if you load an assembly from the command line, it will only be loaded during that session. If you exit the command line, and run the Powershell command line again, you will not have that assembly loaded.&lt;/p&gt;&lt;p&gt;If you have an assembly that you often use during your command line sessions, you should add the load command for that assembly to your profile.ps1 file. For example, include the following command line in your profile.ps1 file to load the System.Web assembly during every Powershell command line session.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;[Reflection.Assembly]::LoadFrom(&amp;quot;C:\WINDOWS\Assembly\Gac\System.Web&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &amp;quot;\1.0.5000.0__b03f5f7f11d50a3a\System.Web.dll&amp;quot;)&lt;/font&gt;&lt;/p&gt;&lt;p&gt;This can be very handy for having command line access to your own custom business objects. Lets say you have a business object that exposes an interface to add a user to your web application. You would be able to load that assembly, create the object instance, and add a user to your web applications all from the command line or a script. Having command line access to your own business objects opens up a whole new world of opportunities.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=121" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Get-Member is your friend</title><link>http://eggins.com/blogs/dev/archive/2007/05/28/get-member-is-your-friend.aspx</link><pubDate>Mon, 28 May 2007 13:45:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:120</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=120</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/28/get-member-is-your-friend.aspx#comments</comments><description>&lt;p&gt;One of the best cmdlets you can use while learning Powershell is &lt;font color="#0000ff" face="courier new,courier"&gt;Get-Member&lt;/font&gt;. This cmdlet will show all available methods and properties on any given type.&lt;/p&gt;&lt;p&gt;If you execute the following command:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;&amp;quot;Hello&amp;quot; | Get-Member&lt;/font&gt;&lt;/p&gt;&lt;p&gt;it will show the following (cut off at the right for brevity):&lt;br /&gt;&lt;font color="#660000" face="courier new,courier" size="1"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TypeName: System.String&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemberType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Definition&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Clone&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Object Clone()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CompareTo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 CompareTo(Object value), System.Int3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Contains&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean Contains(String value)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CopyTo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Void CopyTo(Int32 sourceIndex, Char[] dest&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndsWith&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean EndsWith(String value), System.Boo&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Equals&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean Equals(Object obj), System.Boolean&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetEnumerator&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.CharEnumerator GetEnumerator()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetHashCode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 GetHashCode()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Type GetType()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetTypeCode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.TypeCode GetTypeCode()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_Chars&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Char get_Chars(Int32 index)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 get_Length()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IndexOf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 IndexOf(Char value, Int32 startIndex&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IndexOfAny&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 IndexOfAny(Char[] anyOf, Int32 start&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Insert&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String Insert(Int32 startIndex, String val&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNormalized&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean IsNormalized(), System.Boolean IsN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LastIndexOf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 LastIndexOf(Char value, Int32 startI&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LastIndexOfAny&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 LastIndexOfAny(Char[] anyOf, Int32 s&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Normalize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String Normalize(), System.String Normaliz&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PadLeft&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String PadLeft(Int32 totalWidth), System.S&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PadRight&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String PadRight(Int32 totalWidth), System.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String Remove(Int32 startIndex, Int32 coun&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String Replace(Char oldChar, Char newChar)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Split&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String[] Split(Params Char[] separator), S&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartsWith&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean StartsWith(String value), System.B&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Substring&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String Substring(Int32 startIndex), System&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToCharArray&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Char[] ToCharArray(), System.Char[] ToChar&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToLower&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String ToLower(), System.String ToLower(Cu&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToLowerInvariant Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String ToLowerInvariant()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToString&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String ToString(), System.String ToString(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToUpper&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String ToUpper(), System.String ToUpper(Cu&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToUpperInvariant Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String ToUpperInvariant()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trim&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String Trim(Params Char[] trimChars), Syst&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TrimEnd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String TrimEnd(Params Char[] trimChars)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TrimStart&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String TrimStart(Params Char[] trimChars)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chars&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ParameterizedProperty System.Char Chars(Int32 index) {get;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 Length {get;}&lt;/font&gt;&lt;font color="#660000"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;This shows all of the methods and functions available for the System.String type.&lt;/p&gt;&lt;p&gt;The alias for Get-Member is &amp;quot;gm&amp;quot;. I will use the alias throughout the rest of this post.&amp;nbsp;&lt;/p&gt;&lt;p&gt;You can do this for any type that is loaded into Powershell. For example:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.DateTime] | gm&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.DateTime]::now | gm&lt;/font&gt;&lt;/p&gt;&lt;p&gt;If you want to know what properties and methods are available for directories and files:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dir -path c:\windows | gm&lt;/font&gt;&lt;/p&gt;&lt;p&gt;You will notice that the above command shows two different types, the DirectloryInfo and FileInfo types.&lt;/p&gt;&lt;p&gt;If you want to know what you can do with the objects returned from a Get-ChildItem performed on a registry node:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dir -path hklm:\software |gm&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Basically, if you have an object, or collection of objects, pipe them into Get-Method, and you will know what it can give you, and what it can do for you.&lt;/p&gt;&lt;p&gt;One last Get-Method Example:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;[System.DateTime] | gm -static&lt;/font&gt;&lt;/p&gt;&lt;p&gt;The above command shows all static methods on the [System.DateTime] type. The output is:&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier" size="1"&gt;&lt;font color="#660000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; TypeName: System.DateTime&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemberType Definition&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------- ----------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Int32 Compare(DateTime t1, DateTime t2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DaysInMonth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Int32 DaysInMonth(Int32 year, Int32 month)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Equals&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean Equals(DateTime t1, DateTime t2),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FromBinary&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime FromBinary(Int64 dateData)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FromFileTime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime FromFileTime(Int64 fileTime)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FromFileTimeUtc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime FromFileTimeUtc(Int64 fileTime)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FromOADate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime FromOADate(Double d)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_Now&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime get_Now()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_Today&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime get_Today()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_UtcNow&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime get_UtcNow()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsLeapYear&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean IsLeapYear(Int32 year)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_Addition&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime op_Addition(DateTime d, TimeSpan&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_Equality&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean op_Equality(DateTime d1, DateTime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_GreaterThan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean op_GreaterThan(DateTime t1, DateTi&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_GreaterThanOrEqual Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean op_GreaterThanOrEqual(DateTime t1,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_Inequality&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean op_Inequality(DateTime d1, DateTim&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_LessThan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean op_LessThan(DateTime t1, DateTime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_LessThanOrEqual&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean op_LessThanOrEqual(DateTime t1, Da&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; op_Subtraction&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime op_Subtraction(DateTime d, TimeSp&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parse&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime Parse(String s), static System.Da&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ParseExact&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime ParseExact(String s, String forma&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReferenceEquals&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean ReferenceEquals(Object objA, Objec&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SpecifyKind&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.DateTime SpecifyKind(DateTime value, DateT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TryParse&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean TryParse(String s, DateTime&amp;amp; resul&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TryParseExact&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static System.Boolean TryParseExact(String s, String for&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxValue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; static System.DateTime MaxValue {get;set;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MinValue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; static System.DateTime MinValue {get;set;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; System.DateTime Now {get;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Today&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; System.DateTime Today {get;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UtcNow&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; System.DateTime UtcNow {get;}&lt;br /&gt;&lt;/font&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=120" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>What version of .Net is Powershell using?</title><link>http://eggins.com/blogs/dev/archive/2007/05/28/what-version-of-net-is-powershell-using.aspx</link><pubDate>Mon, 28 May 2007 13:34:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:119</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=119</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/28/what-version-of-net-is-powershell-using.aspx#comments</comments><description>&lt;p&gt;Here is a quick and easy way to find out what version of .Net Powershell is using. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;[Reflection.Assembly]::GetAssembly([String])&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;It uses the GetAssembly static method, passing in the .Net base class type of String.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=119" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Load an assembly in Powershell Pt 1</title><link>http://eggins.com/blogs/dev/archive/2007/05/28/load-an-assembly-in-powershell.aspx</link><pubDate>Mon, 28 May 2007 12:01:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:118</guid><dc:creator>David</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=118</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/28/load-an-assembly-in-powershell.aspx#comments</comments><description>&lt;p&gt;By default, Powershell loads a bunch of assemblies for you so that you can start working with the base types, and some common functions. If you want to use the functionality in an assembly that is not already loaded, you will have to load that assembly yourself. I will describe this process in this blog.&lt;/p&gt;
&lt;p&gt;Firstly, lets look at what assemblies are loaded by default.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000cc" face="courier new,courier"&gt;[System.Threading.Thread]::GetDomain().GetAssemblies()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Produces the following output in my Powershell instance (Sorry about the small font, there is a lot to fit in. You can run this on your PC to get your own results.)&lt;br /&gt;&lt;font color="#660000" face="courier new,courier" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GAC&amp;nbsp;&amp;nbsp;&amp;nbsp; Version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Location&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---&amp;nbsp;&amp;nbsp;&amp;nbsp; -------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --------&lt;br /&gt;&lt;/font&gt;&lt;font color="#660000" face="courier new,courier" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost\1.0.0.0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System.Configuration.Install\2.0.0.0__b03f5&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\1.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\Microsoft.PowerShell.Security\1.0.0.0__31bf&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\1.0.0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System.DirectoryServices\2.0.0.0__b03f5f7f1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System.Management\2.0.0.0__b03f5f7f11d50a3a&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; False&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Program Files\PowerShell Community Extensions\Pscx.dll&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; False&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Program Files\PowerShell Community Extensions\Pscx.Core.dll&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; False&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Program Files\PowerShell Community Extensions\ICSharpCode.SharpZipLib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_32\System.Transactions\2.0.0.0__b77a5c561934e089&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp; v2.0.50727&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\WINDOWS\assembly\GAC_MSIL\System.Data.SqlXml\2.0.0.0__b77a5c561934e08&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So now you want to load another assembly. There are several methods you can use o load an assembly. The first one is to know the full name of the assembly, including the assembly name including namespace, the version, culture, and the Public Key Token if signed.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;[Reflection.Assembly]::Load(&amp;quot;System.Windows.Forms, Version=2.0.0.0, &amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &amp;quot;Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;quot;)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;A slightly easier method is to load the assembly from a fully qualified path&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;[Reflection.Assembly]::LoadFrom(&amp;quot;C:\WINDOWS\assembly\GAC\System.Windows&amp;quot; `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &amp;quot;.Forms\1.0.5000.0__b77a5c561934e089\System.Windows.Forms.dll&amp;quot;)&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Here is an easy way to list all of the fully qualified path names for all assemblies in the GAC&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$GacRootDir = Join-Path -Path $Env:SystemRoot -ChildPath &amp;quot;Assembly/Gac&amp;quot;&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;Get-Childitem -path $GacRootDir -recurse -include *.dll| %{$_.FullName}&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;And now, taking that one step further, you could load all assemblies in the GAC with the following Powershell commands&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$GacRootDir = Join-Path -Path $Env:SystemRoot -ChildPath &amp;quot;Assembly/Gac&amp;quot;&lt;/font&gt;&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Childitem -path $GacRootDir -recurse -include *.dll |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.FullName} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {([Reflection.Assembly]::LoadFrom($_))}&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;If you do not want to display the success and fail message, you can assign the success return objects into $null, and set up a trap block that just continues to the next execution line if an exception ocurrs.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;font color="#0000ff" face="courier new,courier"&gt;$GacRootDir = Join-Path -Path $Env:SystemRoot -ChildPath &amp;quot;Assembly/Gac&amp;quot;&lt;/font&gt;&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Childitem -path $GacRootDir -recurse -include *.dll |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {$_.FullName} |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trap {continue} $null = ([Reflection.Assembly]::LoadFrom($_))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The assemblies do not have to be placed in the GAC in order to be loaded. You can specify the path to any of your own .Net assemblies by supplying the path to that assembly.&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=118" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Powershell Setup</title><link>http://eggins.com/blogs/dev/archive/2007/05/27/powershell-setup.aspx</link><pubDate>Sun, 27 May 2007 10:03:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:117</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=117</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/27/powershell-setup.aspx#comments</comments><description>&lt;p&gt;As you can tell, I am a big fan of Powershell. In this post, I will document my Powershell setup. This is mainly for my own notes, but if you can get something out of this, then well and good. I would expect this to change fairly rapidly, so I will be updating this post as my setup changes with the release of new software versions.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;I am currently using Windows Powershell 1.0 from &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx" title="Powershell 1.0 install"&gt;here&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;I use Powershell Community Extensions 1.1 from &lt;a href="http://www.codeplex.com/PowerShellCX/Release/ProjectReleases.aspx?ReleaseId=873" title="Powershell community extensions"&gt;here&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Make sure you install their profile file. Their Profile file will set you up with all of their added functions, variables, etc. A lot of the following steps assume you have Powershell Community Extensions(PSCX) installed, along with their profile file.&lt;/li&gt;&lt;li&gt;PSCX adds a lot of excelent cmdlets and functions. Read about it on their site.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I then fix a Powershell Community Extensions, profile problem. I edit their VS2005 ps1 file by running this command from the Powershell command line&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;font color="#000099" face="courier new,courier"&gt;notepad (Join-Path $Env:PscxHome &amp;#39;Profile\Profile.ps1&amp;#39;)&lt;/font&gt;&lt;/li&gt;&lt;li&gt;Add the following code at line 33, just after the if statement that determines the base install path&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;font color="#000099" face="courier new,courier"&gt;# Bail out if Visual Studio is not installed&lt;br /&gt;if (!(Test-Path $regKeyPath)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;br /&gt;}&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;font color="#000000"&gt;This stops an error on profile load if you do not have VS2005 installed.&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;font color="#000000"&gt;I like to keep all of my files that I need to back up under the &amp;quot;D:\Data&amp;quot; folder. This makes my backup scripts easier. I also do not like putting any of my personal files on the &amp;quot;C:\&amp;quot;, as this allows me to rebuild the OS partition easily without fear of data loss. To that end, I edit the profile file, and add a new variable which points to my own personal profile folder located at &amp;quot;D:\Data\Scripts\Profile&amp;quot;. I then put a command to run my personal profile file from that location. This means that I have only added two lines to the standard profile, which can be easily repeated after re-install.&amp;nbsp;&lt;/font&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;font color="#000099" face="courier new,courier"&gt;notepad $userprofile&lt;br /&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;Add the following lines to the BOTTOM of the file.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;font color="#000099" face="courier new,courier"&gt;$DavidsProfileScriptsPath = &amp;quot;d:\Data\Scripts\Profile&amp;quot;&lt;br /&gt;. (join-path $DavidsProfileScriptsPath &amp;#39;Profile.ps1&amp;#39;)&lt;/font&gt;&lt;/li&gt;&lt;li&gt;Obviously you will need to create your own profile file in the above location.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;font color="#000000"&gt;In order to have the same profile for all users on my machines, I move my profile to the Powershell home folder. This is because I like to run some of my Powershell functions from sheculer, and from runas. If I leave the profile.ps1 file in the default location, it is only loaded for the userid used to install Powershell. By moving it to the powershell install folder, it is loaded for every console session for every user. Be careful if you do this that you do not have anything in your profile that you would not want other users of your PC to run.&lt;/font&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;font color="#000000"&gt;&lt;font color="#000099" face="courier new,courier"&gt;move $userprofile $PSHome&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font color="#000000"&gt;Now restart powershell to load the new profile from the new location.&lt;/font&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;font color="#000000"&gt;I find that I cannot always remember all of the custom functions that I have created, especially after a break from using Powershell. To solve that problem, I have created a hints function. I do this by:&lt;/font&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;font color="#000000"&gt;Place the following lines in your personal profile file located at &amp;quot;d:\&lt;/font&gt;Data\Scripts\Profile\Profile.ps1&amp;quot;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;font color="#000099" face="courier new,courier"&gt;. (join-path $DavidsProfileScriptsPath &amp;quot;Hints.ps1&amp;quot;)&lt;br /&gt;Get-Hints&lt;/font&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Create the file &amp;quot;d:\Data\Scripts\Profile\Hints.ps1&amp;quot; with the following lines:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;font color="#000099" face="courier new,courier"&gt;Function Get-Hints {&lt;br /&gt;&amp;nbsp; &amp;quot; &amp;quot;&lt;br /&gt;&amp;nbsp; &amp;quot; &amp;quot;&lt;br /&gt;&amp;nbsp; &amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tips&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =========================================&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;command&amp;gt; &amp;nbsp;&amp;nbsp; = &amp;lt;description&amp;gt;&amp;quot;&lt;br /&gt;&lt;/font&gt;&lt;font color="#000099" face="courier new,courier"&gt;&amp;nbsp; &amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;command&amp;gt; &amp;nbsp;&amp;nbsp; = &amp;lt;description&amp;gt;&amp;quot;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#000099" face="courier new,courier"&gt;&amp;nbsp; &amp;quot; &amp;quot;&lt;br /&gt;&amp;nbsp; &amp;quot; &amp;quot;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Set-Alias -name hint -value Show-Hints `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -description &amp;quot;Show the Hints for my own personal functions&amp;quot;&lt;br /&gt;Set-Alias -name hints -value Show-Hints `&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -description &amp;quot;Show the Hints for my own personal functions&amp;quot;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;Yes, I know, I really should use the Write-Host function, but for now,
this keeps the hints file small, easy to read, and easy to edit. If I
ever considered adding colour to the hints, I would use the Write-Host
function.&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;p&gt;&lt;font color="#000000"&gt;Now I have all of my scripts in a location that will not be overwritten by future Powershell installs or Powershell Community Extensions Installs, and can be easily backed up with all of my other files. I get all of my scripts and the default PSCX profile when I run a powershell script under a different userID using RunAs, or the Windows Scheduler. I also have some hints showing my own functions when I start the console, and whenever I type &amp;quot;&lt;font color="#000099" face="courier new,courier"&gt;hint&lt;/font&gt;&amp;quot; on the command line.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;You will have to add your own functions to your personal profile file. My current preference is to create new &amp;quot;.ps1&amp;quot; files in the same directory as my personal profile &amp;quot;D:\Data\Scripts\Profile&amp;quot;, and dot source them in my &amp;quot;profile.ps1&amp;quot; in exactly the same method as the hints function above. I have a common functions ps1 file for generic functions, and specific task related functions get put into their own &amp;quot;.ps1&amp;quot; file based on their target functionality. For example, one &amp;quot;.ps1 file for Team Foundation System functions, one for maintaining my blog, etc.&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=117" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Desktop Search - A must-have productivity tool</title><link>http://eggins.com/blogs/dev/archive/2007/05/18/desktop-search-a-must-have-productivity-tool.aspx</link><pubDate>Fri, 18 May 2007 12:09:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:107</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=107</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/18/desktop-search-a-must-have-productivity-tool.aspx#comments</comments><description>&lt;p&gt;One of the best productivity tools I use is a desktop search. I have tries various incarnations of desktop search application including &amp;quot;Copernic&amp;quot;, &amp;quot;Google Desktop Search&amp;quot;, &amp;quot;X1&amp;quot;, &amp;quot;Yahoo Desktop Search&amp;quot;, and several more obscure desktop search applications.&lt;/p&gt;&lt;p&gt;I settled on Yahoo Desktop Search (YDS) as the best combination of value, performance, and features. YDS is based on the X1 desktop search, and is a free product. Unfortunately it was discontinued recently, but no fear, X1 has a free version of their X1 Desktop Search product, available only to previous YDS users. I cannot tell you what the difference between this free version and the paid X1 product is, but the free one has all that I need.&lt;/p&gt;&lt;p&gt;This free X1 Desktop Search can be found at either of the following links The first link will forward you to the second, but I have included both here in case one disappears.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://desktop.yahoo.com" title="Yahoo Desktop Search"&gt;http://desktop.yahoo.com&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.x1.com/yahoo/" title="X1 Desktop Search Free Version"&gt;http://www.x1.com/yahoo/&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;X1 has the following options for scanning each folder on your file system:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;All Files&lt;/li&gt;&lt;li&gt;File names and sizes, plus content for specified file types&lt;/li&gt;&lt;li&gt;File names and sizes only&lt;/li&gt;&lt;li&gt;Nothing&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I Prefer to use the second option, which fives me all file names, and only the content of the files I specify. This means it will not scan all of my DLLs, Executables, video, audio, etc. X1 provides you with many default file types, including the MS Office file types, PDF, etc. As a developer, I have come up with the following additional file types which I want to be scanned for content. You can paste the following list into the specified extensions by:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Open X1 Desktop Search&lt;/li&gt;&lt;li&gt;Tools &amp;gt; Options&lt;/li&gt;&lt;li&gt;Files&lt;/li&gt;&lt;li&gt;More Indexing Options&lt;/li&gt;&lt;li&gt;Specify Extensions&lt;/li&gt;&lt;li&gt;Copy the following list into the input box&lt;/li&gt;&lt;li&gt;Close&lt;/li&gt;&lt;li&gt;OK&lt;/li&gt;&lt;li&gt;OK&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;.ASAX,.ASCX,.ASMX,.ASP,.ASPX,.ATP,.C,.CONFIG,.CPP,.CS,.CSS,.CSV,.DBF,.DISCO,.DOC,&lt;br /&gt;.GZ,.H,.HTM,.HTML,.JS,.LZA,.LZH,.MP3,.PDF,.PPT,.REG,.RTF,.SLN,.TAR,.TXT,.VB,.VBP,&lt;br /&gt;.VBPROJ,.VBS,.VCPROJ,.WK1,.WK3,.WK4,.WP,.WPD,.XLS,.XML,.XSD,.XSL,.XSLT,.Z,.ZIP,.LOG,.PS1&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=107" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/search/default.aspx">search</category></item><item><title>Regular expressions in Powershell</title><link>http://eggins.com/blogs/dev/archive/2007/05/17/regular-expressions-in-powershell.aspx</link><pubDate>Thu, 17 May 2007 12:35:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:106</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=106</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/17/regular-expressions-in-powershell.aspx#comments</comments><description>&lt;p&gt;Here is a simple example of using Regular Expressions (Regex) in Powershell. It will find any string starting with &amp;quot;http://&amp;quot; and ending with &amp;quot;.com&amp;quot;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; # Set up the pattern to look for. This is a non-greedy search for http links in the &amp;quot;com&amp;quot; TLD&lt;br /&gt;&amp;nbsp; $Pattern = [regex]&amp;quot;http://(?&amp;lt;Site&amp;gt;.*?)\.com&amp;quot;&lt;br /&gt;&amp;nbsp; # Execute the find&lt;br /&gt;&amp;nbsp; $Match = $Pattern.Match(&amp;quot;&amp;lt;a href=&amp;#39;http://www.eggins.com&amp;#39;&amp;gt;Eggins.com&amp;lt;/a&amp;gt;&lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;lt;a href=&amp;#39;http://www.microsoft.com&amp;#39;&amp;gt;Microsoft.com&amp;lt;/a&amp;gt;&lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;quot;)&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; # Loop through all matches, displaying the matching value&lt;br /&gt;&amp;nbsp; While ($Match.Success) {&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;Show the entire match:&amp;nbsp; &amp;quot; $Match.Groups[0].Value&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &amp;quot;Show the named group:&amp;nbsp;&amp;nbsp; &amp;quot; $Match.Groups[&amp;quot;Site&amp;quot;].Value&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Match = $Match.NextMatch()&lt;br /&gt;&amp;nbsp; }&lt;/font&gt; &lt;/p&gt;&lt;p&gt;The output of this script is:&lt;/p&gt;&lt;p&gt;&lt;font color="#660000" face="courier new,courier"&gt;&amp;nbsp; Show the entire match:&amp;nbsp;&amp;nbsp; http://www.eggins.com&lt;br /&gt;&amp;nbsp; Show the named group:&amp;nbsp;&amp;nbsp;&amp;nbsp; www.eggins&lt;br /&gt;&amp;nbsp; Show the entire match:&amp;nbsp;&amp;nbsp; http://www.microsoft.com&lt;br /&gt;&amp;nbsp; Show the named group:&amp;nbsp;&amp;nbsp;&amp;nbsp; www.microsoft&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=106" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/regex/default.aspx">regex</category></item><item><title>Get HTML using Powershell</title><link>http://eggins.com/blogs/dev/archive/2007/05/17/get-html-using-powershell.aspx</link><pubDate>Thu, 17 May 2007 12:28:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:105</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=105</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/17/get-html-using-powershell.aspx#comments</comments><description>&lt;p&gt;The following powershell command uses the .Net library to download a HTML page from the web and displays it in the console.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000cc" face="courier new,courier"&gt;&amp;nbsp; (New-Object Net.WebClient).DownloadString(&amp;quot;http://www.eggins.com&amp;quot;)&lt;/font&gt;&lt;/p&gt;&lt;p&gt;You must include the protocol &amp;quot;http://&amp;quot; in the web address. This can also be used for ftp if you prefix the site with &amp;quot;ftp://&amp;quot;.&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=105" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Powershell Date Formatting</title><link>http://eggins.com/blogs/dev/archive/2007/05/17/powershell-date-formatting.aspx</link><pubDate>Thu, 17 May 2007 08:44:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:104</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=104</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/17/powershell-date-formatting.aspx#comments</comments><description>&lt;p&gt;There are many date formatting options available to Powershell using the .net format specifiers.&lt;/p&gt;&lt;p&gt;I will show some examples below, and you can look to the end of this post to see alla vailable format specifiers.&lt;/p&gt;&lt;p&gt;To format a date to long date:&lt;br /&gt;&lt;font color="#3300ff"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;quot;{0:D}&amp;quot; -f [DateTime]&amp;quot;7/14/2007&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;Produces&lt;br /&gt;&lt;font color="#3300ff"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &lt;font color="#660000"&gt;Saturday, 14 July 2007&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;To format a date to show day, date, and time:&lt;br /&gt;
&lt;font color="#3300ff"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;quot;{0:dddd, dd MMM yyyy, hh:mm:ss}&amp;quot; -f [DateTime]&amp;quot;7/14/2007&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
Produces&lt;br /&gt;
&lt;font color="#3300ff"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &lt;font color="#660000"&gt;Saturday, 14 Jul 2007, 12:00:00&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h3&gt;&lt;font face="Verdana"&gt;Dates&lt;/font&gt;&lt;/h3&gt;
Note that date formatting is especially dependant on the system’s
regional settings; the example strings here are from my local locale.

&lt;table&gt;

&lt;tr&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;font size="2"&gt;Specifier&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;font size="2"&gt;Type&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;font size="2"&gt;Example (Passed System.DateTime.Now)&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;d&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Short date&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10/12/2002&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;D&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Long date&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;December 10, 2002&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;t&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Short time&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10:11 PM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;T&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Long time&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10:11:29 PM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;f&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Full date &amp;amp; time &lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;December 10, 2002 10:11 PM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;F&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Full date &amp;amp; time (long)&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;December 10, 2002 10:11:29 PM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;g&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Default date &amp;amp; time&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10/12/2002 10:11 PM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;G&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Default date &amp;amp; time (long)&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10/12/2002 10:11:29 PM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;M&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Month day pattern&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;December 10&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;r&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;RFC1123 date string&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Tue, 10 Dec 2002 22:11:29 GMT&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;s&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Sortable date string&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;2002-12-10T22:11:29&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;u&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Universal sortable, local time&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;2002-12-10 22:13:50Z&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;U&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Universal sortable, GMT&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;December 11, 2002 3:13:50 AM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;Y&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Year month pattern&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;December, 2002&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;&lt;p&gt;&lt;b&gt;Custom date formatting:&lt;/b&gt;&lt;/p&gt;



&lt;table&gt;&lt;tr&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;font size="2"&gt;Specifier&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;font size="2"&gt;Type&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;font size="2"&gt;Example   &lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;font size="2"&gt;Example Output&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;dd&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Day&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:dd}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;ddd&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Day name&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:ddd}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Tue&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;dddd&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Full day name&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:dddd}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Tuesday&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;f, ff, …&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Second fractions&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:fff}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;932&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;gg, …&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Era&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:gg}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;A.D.&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;hh&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;2 digit hour&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:hh}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;HH&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;2 digit hour, 24hr format&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:HH}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;22&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;mm&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Minute 00-59&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:mm}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;38&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;MM&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Month 01-12&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:MM}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;12&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;MMM&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Month abbreviation&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:MMM}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Dec&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;MMMM&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Full month name&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:MMMM}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;December&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;ss&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Seconds 00-59&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:ss}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;46&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;tt&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;AM or PM&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:tt}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;PM&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;yy&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Year, 2 digits&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:yy}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;02&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;yyyy&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Year&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:yyyy}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;2002&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;zz&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Timezone offset, 2 digits&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:zz}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;-05&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;zzz&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Full timezone offset&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:zzz}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;-05:00&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;:&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Separator&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:hh:mm:ss}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10:43:20&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;font size="2"&gt;/&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;Separator&lt;/font&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;font face="Courier New" size="2"&gt;{0:dd/MM/yyyy}&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="2"&gt;10/12/2002&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;More details on the full range of format specifier strings here:&lt;br /&gt;

&amp;nbsp;&amp;nbsp; &lt;a href="http://eggins.com/files/folders/103/download.aspx" title="Format Specifier Strings"&gt;http://eggins.com/files/folders/103/download.aspx&lt;/a&gt;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=104" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/dotnet/default.aspx">dotnet</category><category domain="http://eggins.com/blogs/dev/archive/tags/formatting/default.aspx">formatting</category></item><item><title>Powershell Number Formatting</title><link>http://eggins.com/blogs/dev/archive/2007/05/17/powershell-number-formatting.aspx</link><pubDate>Thu, 17 May 2007 08:04:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:99</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=99</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/17/powershell-number-formatting.aspx#comments</comments><description>&lt;p&gt;The number formatting features available to Powershell though the dot net String.Format() function are a lot more exciting than the string formatting mentioned in my last post.&lt;/p&gt;
&lt;p&gt;I will give some examples here, and you may look at the end of this post for more formatting specifiers.&lt;/p&gt;
&lt;p&gt;To pad a number with leading zeros:&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &amp;quot;{0:00#}&amp;quot; -f 34&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;Produces&lt;br /&gt;
&lt;span style="color:#0000ff;"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &lt;font color="#660000"&gt;034&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:#660000;"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To format a number with comma separators and two decimal places:&lt;br /&gt;
&lt;span style="color:#0000ff;"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &amp;quot;{0:0,0.00}&amp;quot; -f 443567443&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;Produces&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &lt;font color="#660000"&gt;443,567,443.00&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To format a number as currency using your region settings:&lt;br /&gt;
&lt;span style="color:#0000ff;"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &amp;quot;{0:c.00}&amp;quot; -f 443567443&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;Produces (for me)&lt;br /&gt;
&lt;span style="color:#0000ff;"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &lt;font color="#660000"&gt;$443,567,443.00&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To right-align a column of numbers, while specifying the numeric format:&lt;br /&gt;&lt;span style="font-family:courier new,courier;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;font face="courier new,courier"&gt;1,22,33.3333,44444.4 | %{&amp;quot;Free: {0,9:#,#.00} GB&amp;quot; -f $_}&lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;Produces&lt;br /&gt;&lt;/font&gt;&lt;font color="#993300" face="courier new,courier"&gt;&amp;nbsp; Free:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.00 GB&lt;br /&gt;&amp;nbsp; Free:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22.00 GB&lt;br /&gt;&amp;nbsp; Free:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33.33 GB&lt;br /&gt;&amp;nbsp; Free: 44,444.40 GB&amp;nbsp; &lt;br /&gt;&lt;/font&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span style="font-family:Verdana;"&gt;Numbers&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;Basic number formatting specifiers:&lt;/p&gt;
&lt;table&gt;

&lt;tr&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Specifier&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Type&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Format  &lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Output (Passed Double 1.42)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Output (Passed Int -12400)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;c&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Currency&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:c}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;$1.42&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;-$12,400&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;d&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Decimal (Whole number)&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:d}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;System.FormatException&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;-12400&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;e&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Scientific&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:e}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1.420000e+000&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;-1.240000e+004&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;f&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Fixed point&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:f}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;-12400.00&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;g&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;General&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:g}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;-12400&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;n&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Number with commas for thousands&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:n}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;-12,400&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;r&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Round trippable&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:r}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;System.FormatException&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;x&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Hexadecimal&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:x4}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;System.FormatException&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;cf90&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;Custom number formatting:&lt;/p&gt;
&lt;table&gt;

&lt;tr&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Specifier&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Type&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Example   &lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Output (Passed Double 1500.42)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;b&gt;&lt;span style="font-size:x-small;"&gt;Note&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;0&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Zero placeholder&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:00.0000}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1500.4200&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Pads with zeroes.&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;#&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Digit placeholder&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:(#).##}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;(1500).42&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;.&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Decimal point&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:0.0}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1500.4&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;,&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Thousand separator&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:0,0}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;1,500&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Must be between two zeroes.&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;,.&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Number scaling&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-family:Courier New;"&gt;{0:0,.}&lt;/span&gt; &lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;2&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Comma adjacent to Period scales by 1000.&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;%&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Percent&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:0%}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;150042%&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Multiplies by 100, adds % sign.&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;e&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Exponent placeholder&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;{0:00e+0}&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;15e+2&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Many exponent formats available.&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt;Group separator&lt;/span&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;span style="font-size:x-small;"&gt;see below&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;The group separator is especially useful for formatting currency values
which require that negative values be enclosed in parentheses. This
currency formatting example makes it
obvious:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Courier New;font-size:x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String.Format(&amp;rdquo;{0:$#,##0.00;($#,##0.00);Zero}&amp;rdquo;, value);&lt;/span&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right:0px;"&gt;
&lt;p&gt;This will output &amp;ldquo;$1,240.00&amp;Prime; if passed 1243.50. It will output the
same format but in parentheses if the number is negative, and will
output the string &amp;ldquo;Zero&amp;rdquo; if the number is zero.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;More details on the full range of format specifier strings here:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;a href="http://eggins.com/files/folders/103/download.aspx" title="Format Specifier Strings"&gt;http://eggins.com/files/folders/103/download.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=99" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/dotnet/default.aspx">dotnet</category><category domain="http://eggins.com/blogs/dev/archive/tags/formatting/default.aspx">formatting</category></item><item><title>Powershell String Formatting</title><link>http://eggins.com/blogs/dev/archive/2007/05/17/powershell-string-formatting.aspx</link><pubDate>Thu, 17 May 2007 07:28:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:98</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=98</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/17/powershell-string-formatting.aspx#comments</comments><description>&lt;p&gt;Powershell uses the .Net string formatting features in String.Format. The only formatting functionality for a string is the alignment.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To left align a string and pad to 40 chars, the following two lines produce the same result:&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; [System.String]::Format(&amp;quot;{0,-40}&amp;quot;, &amp;quot;MTB rules&amp;quot;)&lt;br /&gt;&amp;nbsp; &amp;quot;{0,-40}&amp;quot; -f &amp;quot;MTB Rules&amp;quot;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To right align a string and pad to 40 chars, the following two lines produce the same result:&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;[System.String]::Format(&amp;quot;{0,40}&amp;quot;, &amp;quot;MTB rules&amp;quot;)&lt;br /&gt;&amp;nbsp; &amp;quot;{0,40}&amp;quot; -f &amp;quot;MTB Rules&amp;quot;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Here is a more complex example:&lt;br /&gt;&lt;font color="#0000ff"&gt;&lt;font face="courier new,courier"&gt;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;quot;{0,-40} flies like a {1,40}&amp;quot; -f &amp;quot;Fruit&amp;quot;, &amp;quot;Bannana&amp;quot;&lt;/font&gt;&lt;br /&gt;Produces (without the quotes):&lt;br /&gt;&lt;font color="#0000ff" face="courier new,courier"&gt;&amp;nbsp; &amp;quot;Fruit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flies like a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bannana&amp;quot;&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;More details on the full range of format specifier strings here:&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;a href="http://eggins.com/files/folders/103/download.aspx" title="Format Specifier Strings"&gt;http://eggins.com/files/folders/103/download.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=98" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/dotnet/default.aspx">dotnet</category><category domain="http://eggins.com/blogs/dev/archive/tags/formatting/default.aspx">formatting</category></item><item><title>IIS SMTP Settings</title><link>http://eggins.com/blogs/dev/archive/2007/05/17/iis-smtp-settings.aspx</link><pubDate>Thu, 17 May 2007 04:54:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:97</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=97</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/17/iis-smtp-settings.aspx#comments</comments><description>&lt;p&gt;You can set up&amp;nbsp; your application to send emails using the System.Web.Mail.SmtpMail class. You must supply the name or IP address of your SMTP mail server or relay using the SmtpServer property:&lt;/p&gt;&lt;p&gt;&lt;font color="#0000cc" face="courier new,courier" size="2"&gt;SmtpMail.SmtpServer = &amp;quot;MyMailServer&amp;quot;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;If you want to keep a record of the email sent using your application, you can set up the SMTP component of IIS on your Windows OS and have it relay the email to your mail server. This allows you to look at the SMTP log in IIS, so help with testing and determining problems. To set this up:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Install the SMTO component of IIS using Add Remove windows components&lt;/li&gt;&lt;li&gt;Start the SMTP component of IIS using the IIS configuration application&lt;/li&gt;&lt;li&gt;Enable logging for the Default SMTP Virtual Server under the general tab&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Set the logging to include all of the extended properties you wish to log using the Advanced button. By default it is pretty minimal&lt;/li&gt;&lt;li&gt;Set the smart host to your SMTP server by clicking the Advanced button on the Delivery tab.&lt;/li&gt;&lt;li&gt;&lt;font color="#ff0000"&gt;By default, yor application cannot use the local SMTP server to relay emails.&lt;/font&gt; You can click the Relay button on the Access tab and either Select &amp;quot;All except the list below&amp;quot;, or add the names of the machine(s) that are allowed to use this SMTP service as a relay. The secont option is more secure.&lt;/li&gt;&lt;li&gt;Now you can point your software at the localhost SMTP service. &lt;font color="#0000cc" face="courier new,courier" size="2"&gt;SmtpMail.SmtpServer = &amp;quot;Localhost&amp;quot;&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now you can look in the following folder to see emails that are qued, bad, etc:&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="courier new,courier" size="2"&gt;C:\Inetpub\mailroot&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;And you can look in this folder for the log of email sent:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;font color="#0000ff" face="courier new,courier" size="2"&gt;C:\WINDOWS\system32\LogFiles\W3SVC1&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=97" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/iis/default.aspx">iis</category><category domain="http://eggins.com/blogs/dev/archive/tags/smtp/default.aspx">smtp</category></item><item><title>A good collection of Powershell scripts for TFS</title><link>http://eggins.com/blogs/dev/archive/2007/05/11/a-good-collection-of-powershell-scripts-for-tfs.aspx</link><pubDate>Fri, 11 May 2007 04:01:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:77</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=77</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/05/11/a-good-collection-of-powershell-scripts-for-tfs.aspx#comments</comments><description>&lt;p&gt;This is a good collection of Powershell scripts for Team Fountation Server.&lt;/p&gt;&lt;p&gt;http://blogs.msdn.com/jmanning/pages/various-powershell-scripts.aspx&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=77" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category><category domain="http://eggins.com/blogs/dev/archive/tags/tfs/default.aspx">tfs</category></item><item><title>Disable Vista's UAC</title><link>http://eggins.com/blogs/dev/archive/2007/04/26/disable-vista-s-uac.aspx</link><pubDate>Thu, 26 Apr 2007 06:55:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:60</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=60</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/04/26/disable-vista-s-uac.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p&gt;Want to disable Vista&amp;#39;s UAC? Here&amp;#39;s how:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/tims/archive/2006/09/20/windows-vista-secret-4-disabling-uac.aspx"&gt;http://blogs.msdn.com/tims/archive/2006/09/20/windows-vista-secret-4-disabling-uac.aspx&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=60" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/vista/default.aspx">vista</category></item><item><title>Ctrl C to get text from error messages</title><link>http://eggins.com/blogs/dev/archive/2007/04/26/ctrl-c-to-get-text-from-error-messages.aspx</link><pubDate>Thu, 26 Apr 2007 05:48:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:59</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=59</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/04/26/ctrl-c-to-get-text-from-error-messages.aspx#comments</comments><description>When you get an information message, worning message, or error message in Windows and it shows you the standard error message dialog, you can copy all text from that window including the window title, the message, and the text in the command buttons by giving that message box the focus, and hitting Ctrl+C.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=59" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/tips/default.aspx">tips</category></item><item><title>searchdotnet.com</title><link>http://eggins.com/blogs/dev/archive/2007/04/25/searchdotnet.com.aspx</link><pubDate>Thu, 26 Apr 2007 05:20:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:58</guid><dc:creator>David</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=58</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/04/25/searchdotnet.com.aspx#comments</comments><description>&lt;p&gt;You can create your own custom searches in Google, where you limit the results to a user defined set of sites. Dan Appleman has created a .net specific search site.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.searchdotnet.com/"&gt;http://www.searchdotnet.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=58" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/dotnet/default.aspx">dotnet</category></item><item><title>TFS and VSTS Developer addins</title><link>http://eggins.com/blogs/dev/archive/2007/04/19/tfs-and-vsts-developer-addins.aspx</link><pubDate>Thu, 19 Apr 2007 00:54:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:57</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=57</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/04/19/tfs-and-vsts-developer-addins.aspx#comments</comments><description>&lt;p&gt;A bunch of developer addins for VSTS and TFS:&lt;span style="FONT-FAMILY:Symbol;"&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;TFS Deployer&lt;/strong&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://notgartner.wordpress.com/2006/12/16/getting-started-with-tfs-deployer/"&gt;http://notgartner.wordpress.com/2006/12/16/getting-started-with-tfs-deployer/&lt;/a&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Free&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;Run custom Powershell scripts on VSTS events.&lt;/li&gt;
&lt;li&gt;Great for Continuous Integration&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;&lt;strong&gt;TFS permissions manager&lt;/strong&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://blogs.microsoft.co.il/files/folders/leon/entry5018.aspx"&gt;http://blogs.microsoft.co.il/files/folders/leon/entry5018.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Free&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;Much easier to set up all the permissions needed when installing and setting up VSTS.&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;To use, Connect to your VSTS instance, and Retrieve Groups or users.&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Alternatively could use &amp;quot;TFS Admin&amp;quot; tool, but this one appears better&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;&lt;span style="FONT-FAMILY:Symbol;"&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;TFSSecurity.exe&lt;/strong&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.codeproject.com/dotnet/tfssecuritytools.asp"&gt;http://www.codeproject.com/dotnet/tfssecuritytools.asp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Comes with VSTS&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Command line version of TFS Permissions Manage&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;&lt;strong&gt;TFS PowerTools&lt;/strong&gt; (previously named TFS Powertoys)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa718351.aspx"&gt;http://msdn2.microsoft.com/en-us/vstudio/aa718351.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Free&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Put TFPT.exe in your PATH environment variable&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Help Forum:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=930&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=930&amp;amp;SiteID=1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;When migrate to new branch, the History will not migrate.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Need to use a post-migrate option (&amp;quot;History/ &amp;lt;did not record this!&amp;gt;&amp;quot;)&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;
&lt;li&gt;&lt;strong&gt;TFS Sidekick&lt;/strong&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.attrice.info/cm/tfs/index.htm"&gt;http://www.attrice.info/cm/tfs/index.htm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Lots of useful, tiny footprint tools&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;&lt;strong&gt;BugSnapper&lt;/strong&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.holliday.com.au/display/ShowJournal?moduleId=349905&amp;amp;categoryId=47050"&gt;http://www.holliday.com.au/display/ShowJournal?moduleId=349905&amp;amp;categoryId=47050&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Free&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Iintegrate with VSTS without opening VS.net&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Allows saving of a bug (including screen shots) in a very efficient manner&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Usage:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Take a screenshot&lt;/li&gt;
&lt;li&gt;Save as new bug&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Saves many manual steps&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;Can also point it at a folder to select images from. Good for use with Snagit&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Allows for search of Work Item (immediate!) without going through VS 2005 IDE (slower).&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Outlook 2007 TFS Addin&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/files/folders/leon/entry9509.aspx"&gt;&lt;span&gt;http://blogs.microsoft.co.il/files/folders/leon/entry9509.aspx&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Free&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;font-size-adjust:none;font-stretch:normal;"&gt;&lt;/span&gt;&lt;/span&gt;Outlook 2007 addin to create a WorkItem from an email&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=57" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/dotnet/default.aspx">dotnet</category><category domain="http://eggins.com/blogs/dev/archive/tags/tfs/default.aspx">tfs</category><category domain="http://eggins.com/blogs/dev/archive/tags/vsts/default.aspx">vsts</category></item><item><title>MCMS to MOSS migration whitepaper</title><link>http://eggins.com/blogs/dev/archive/2007/04/19/mcms-to-moss-migration-whitepaper.aspx</link><pubDate>Thu, 19 Apr 2007 00:20:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:56</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=56</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/04/19/mcms-to-moss-migration-whitepaper.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p&gt;Want to move your Microsoft Content Management Server (MCMS) 2002 sites to Microsoft Office Sharepoint Server (MOSS)? Read this witepaper:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://vividgroup.com.au/pages_2004/news_27032007.asp"&gt;http://vividgroup.com.au/pages_2004/news_27032007.asp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Direct link:&lt;br /&gt;&lt;a href="http://vividgroup.com.au/pdf/MCMS2002ToMOSS2007Migration-WhitePaper.pdf"&gt;http://vividgroup.com.au/pdf/MCMS2002ToMOSS2007Migration-WhitePaper.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks Nick...&lt;/p&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=56" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/mcms/default.aspx">mcms</category><category domain="http://eggins.com/blogs/dev/archive/tags/sharepoint/default.aspx">sharepoint</category></item><item><title>Powershell - Get longest path length</title><link>http://eggins.com/blogs/dev/archive/2007/04/04/powershell-get-longest-path-length.aspx</link><pubDate>Wed, 04 Apr 2007 03:59:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:55</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=55</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/04/04/powershell-get-longest-path-length.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p&gt;Windows has a path length limit of 255 chars. If you are going to copy a bunch of files around that are contained within a deep hierarchy, you run the risk of hitting this limit.&lt;/p&gt;
&lt;p&gt;To check the length of the longest file name including the entire path length, use this PowerShell script.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;cd &amp;quot;C:\MyDir&amp;quot;&lt;br /&gt;$len=0;dir -r|%{if ($_.FullName.Length -gt $len) {$len=$_.FullName.Length}};$len&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=55" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>&lt;i&gt; and &lt;b&gt; are deprecated</title><link>http://eggins.com/blogs/dev/archive/2007/04/02/lt-i-gt-and-lt-b-gt-are-deprecated.aspx</link><pubDate>Mon, 02 Apr 2007 05:05:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:54</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=54</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/04/02/lt-i-gt-and-lt-b-gt-are-deprecated.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p&gt;As of May 2001, the W3C Standards state that &amp;lt;i&amp;gt; and &amp;lt;b&amp;gt; are deprecated.&lt;/p&gt;
&lt;p&gt;These tags give away too much as to the formatting of the text. XML and XHTML&amp;nbsp;are meant to describe the data, not the layout. To that end XHTML v1.0 states that you must&amp;nbsp;use the following instead:&lt;/p&gt;
&lt;p&gt;&amp;lt;em&amp;gt;Emphasis (usually italicised)&amp;lt;/em&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Strong emphahsis (usually bolded)&amp;lt;/strong&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=54" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://eggins.com/blogs/dev/archive/tags/html/default.aspx">html</category></item><item><title>ASP.Net Repeater control formatting</title><link>http://eggins.com/blogs/dev/archive/2007/03/29/asp-net-repeater-control-formatting.aspx</link><pubDate>Thu, 29 Mar 2007 06:18:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:52</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=52</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/03/29/asp-net-repeater-control-formatting.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p&gt;The code below is a quick demo of an ASP.Net Repeater control, writing a link, dates, and description, repeated from database. It shows how to repeat a table for data formatting per data row. It also shows the date formatting within Databinder.Eval.&lt;/p&gt;
&lt;p&gt;//----------------------------------&lt;br /&gt;&amp;lt;asp:Repeater ID=&amp;quot;publicConsultationsRepeater&amp;quot; Runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h4&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;%# DataBinder.Eval(Container.DataItem, &amp;quot;Url&amp;quot;) %&amp;gt;&amp;quot;&amp;gt;&amp;lt;%# DataBinder.Eval(Container.DataItem, &amp;quot;Name&amp;quot;) %&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h4&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;table cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; cols=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;Date opened:&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%# DataBinder.Eval(Container.DataItem, &amp;quot;StartDate&amp;quot;, &amp;quot;{0: dd MMMM yyyy}&amp;quot;) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;Agency:&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%# DataBinder.Eval(Container.DataItem, &amp;quot;Name&amp;quot;) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;&amp;lt;%# DataBinder.Eval(Container.DataItem, &amp;quot;Description&amp;quot;) %&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:Repeater&amp;gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=52" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/asp.net/default.aspx">asp.net</category></item><item><title>Server side comments</title><link>http://eggins.com/blogs/dev/archive/2007/03/29/server-side-comments.aspx</link><pubDate>Thu, 29 Mar 2007 06:08:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:53</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=53</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/03/29/server-side-comments.aspx#comments</comments><description>&lt;p&gt;To have server side comments in aspx page:&lt;/p&gt;
&lt;p&gt;&amp;lt;%-- This is a server side comment --%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- This comment goes to the client --&amp;gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=53" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/asp.net/default.aspx">asp.net</category></item><item><title>SQL Compare</title><link>http://eggins.com/blogs/dev/archive/2007/03/29/sql-compare.aspx</link><pubDate>Thu, 29 Mar 2007 06:02:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:51</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=51</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/03/29/sql-compare.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p&gt;Recommended tool for SQL schema and data comparisons to merger dev changes into prod database.&lt;/p&gt;
&lt;p&gt;http://redgate.com/products/SQL_Compare/index.htm&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;The DB skew of Visual Studio 2005 Team edition is about to be released, which also performs this function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=51" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/tool/default.aspx">tool</category><category domain="http://eggins.com/blogs/dev/archive/tags/sql+server/default.aspx">sql server</category></item><item><title>IIS Log analysis tool</title><link>http://eggins.com/blogs/dev/archive/2007/03/29/iis-log-analysis-tool.aspx</link><pubDate>Thu, 29 Mar 2007 05:55:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:48</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=48</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/03/29/iis-log-analysis-tool.aspx#comments</comments><description>&lt;p&gt;Just learned about this very cool free tool to monitor and highlight particular activity on IIS logs.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.baremetalsoft.com/baretail/"&gt;http://www.baremetalsoft.com/baretail/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks Nick!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=48" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/tool/default.aspx">tool</category><category domain="http://eggins.com/blogs/dev/archive/tags/iis/default.aspx">iis</category></item><item><title>Drag-Drop to execute Powershell scripts</title><link>http://eggins.com/blogs/dev/archive/2007/02/22/drag-drop-to-execute-powershell-scripts.aspx</link><pubDate>Thu, 22 Feb 2007 04:12:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:67</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=67</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/02/22/drag-drop-to-execute-powershell-scripts.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p&gt;Save this batch file to the HDD where your powershell script files are. You can then drag your powershell &amp;quot;PS1&amp;quot; files onto this batch file and they will be executed.&lt;/p&gt;
&lt;p&gt;REM ---------------- Start Batch file&lt;br /&gt;&amp;quot;C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe\powershell.exe&amp;quot; -Command &amp;quot;%1&amp;quot;&lt;br /&gt;pause&lt;br /&gt;REM ---------------- End Batch File&lt;/p&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=67" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Powershell - Load 256 chars into char array</title><link>http://eggins.com/blogs/dev/archive/2007/02/22/powershell-load-256-chars-into-char-array.aspx</link><pubDate>Thu, 22 Feb 2007 02:06:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:69</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=69</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/02/22/powershell-load-256-chars-into-char-array.aspx#comments</comments><description>&lt;div class="asset-body"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;All 4 of these &lt;span&gt;&lt;strong&gt;Powershell&lt;/strong&gt;&lt;/span&gt; lines do exactly the same thing&lt;span class="318014223-18022007"&gt;. Load the first 256 chars into a char array.&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;&lt;span class="318014223-18022007"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="FONT-SIZE:small;FONT-FAMILY:arial;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;for ([int]$i = 0; $i -le 255; $i++) {$a += [char]$i};&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="FONT-SIZE:small;FONT-FAMILY:arial;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;0..255|%{$a+=[char]$_}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="FONT-SIZE:small;FONT-FAMILY:arial;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;$a=0..255|%{[char]$_}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="FONT-SIZE:small;FONT-FAMILY:arial;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;[char[]]$a=0..255&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=69" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item><item><title>Powershell - Create podcast download HTML</title><link>http://eggins.com/blogs/dev/archive/2007/02/22/powershell-create-podcast-download-html.aspx</link><pubDate>Thu, 22 Feb 2007 02:04:00 GMT</pubDate><guid isPermaLink="false">d44cf04a-6a03-4ca9-84f9-9d99c7b94c52:70</guid><dc:creator>David</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://eggins.com/blogs/dev/rsscomments.aspx?PostID=70</wfw:commentRss><comments>http://eggins.com/blogs/dev/archive/2007/02/22/powershell-create-podcast-download-html.aspx#comments</comments><description>&lt;p&gt;Occasionally, I need to download many files from a single site, where all of the files are numbered. For example, catching up on podcasts. To make this easier, I would usually create a html file, listing all of the files as links, and then use the Firefox extension &amp;quot;DownThemAll&amp;quot; to download those files.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;If there are a lot of files, creating the html file can be time consuming. Below is a small powershell command line that will create a file with numbered files, formatted as HTML links. It can be easily modified to create any file with incrementing numerical output...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-size:1em;"&gt;1..10 | foreach-object -begin {&amp;quot;&amp;lt;html&amp;gt;&amp;quot;} -process{&amp;quot;&amp;lt;a href=`&amp;quot;http://www.files.com/File&amp;quot; + ([string]$_).PadLeft(3,&amp;quot;0&amp;quot;) + &amp;quot;.mp3`&amp;quot;&amp;gt;File&amp;quot; + $_ + &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;} -end{&amp;quot;&amp;lt;/html&amp;gt;&amp;quot;} | set-content c:\&amp;quot;download.html&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;And here is the same command in a much more brief format.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:1em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;i&gt;1..10|% -b
{&amp;quot;&amp;lt;html&amp;gt;&amp;quot;} -p{&amp;quot;&amp;lt;a href=`&amp;quot;http://www.files.com/File&amp;quot;+([string]$_).PadLeft(3,&amp;quot;0&amp;quot;)+&amp;quot;.mp3`&amp;quot;&amp;gt;File&amp;quot;+$_+&amp;quot;&amp;lt;/a&amp;gt;&amp;quot;}
-en{&amp;quot;&amp;lt;/html&amp;gt;&amp;quot;}|sc &amp;quot;c:\download.html&lt;/i&gt;&amp;quot;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This is what is written to the c:\download.html file after running this command:&lt;/p&gt;&lt;p&gt;&lt;font color="#660000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;html&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File001.mp3&amp;quot;&amp;gt;File1&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File002.mp3&amp;quot;&amp;gt;File2&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File003.mp3&amp;quot;&amp;gt;File3&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File004.mp3&amp;quot;&amp;gt;File4&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File005.mp3&amp;quot;&amp;gt;File5&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File006.mp3&amp;quot;&amp;gt;File6&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File007.mp3&amp;quot;&amp;gt;File7&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File008.mp3&amp;quot;&amp;gt;File8&amp;lt;/a&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File009.mp3&amp;quot;&amp;gt;File9&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.files.com/File010.mp3&amp;quot;&amp;gt;File10&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://eggins.com/aggbug.aspx?PostID=70" width="1" height="1"&gt;</description><category domain="http://eggins.com/blogs/dev/archive/tags/powershell/default.aspx">powershell</category></item></channel></rss>