Zi's Blog


Text-xml

Posted in Tips n Tricks by zimakki on the July 24th, 2008

Just stumbled on this cool PowerShell method. Below is are a couple of examples of how I see myself using it:

73> ni -type file -value “<crap></xml>” -name “crap.xml”

    Directory: Microsoft.PowerShell.Core\FileSystem::C:\projects\depot\Test

Mode           LastWriteTime       Length Name
—-           ————-       —— —-
-a—    24/07/2008    19:36           12 crap.xml

74> test-xml .\crap.xml
False
75> ni -type file -value “<hello></hello>” -name “valid.xml”

    Directory: Microsoft.PowerShell.Core\FileSystem::C:\projects\depot\Test

Mode           LastWriteTime       Length Name
—-           ————-       —— —-
-a—    24/07/2008    19:37           15 valid.xml

76> test-xml .\valid.xml
True
77> test-xml .\crap.xml -ErrorVariable
Test-Xml : Missing an argument for parameter ‘ErrorVariable’. Specify a parameter of type ‘System.String’ and try again.
At line:1 char:35

+ test-xml .\crap.xml -ErrorVariable <<<<

 

This will help me out when I fiddling around with all the nAnt build scripts I seem to be playing with these days!

 

Technorati Tags:

Windows Live Writer Beta 2 out

Posted in Tips n Tricks,Utilities by zimakki on the June 11th, 2007

Go here to download.

Technorati tags:

Making use of "Send To" in Windows XP

Posted in Tips n Tricks,Utilities by zimakki on the August 25th, 2006

One of my favourite utilities is Lutz Roeder’s Reflector. But I didn’t like the way I had to always open it then copy the DLL I am trying to reflect on into it (I’m lazy ok!). So adding a link into the “SendTo” folder enables me to right click a DLL and send it to reflector.

This is how I did it:

1. Open the SendTo folder:
 - Open the run dialog box (Windows Key + R) and type “SendTo” then click enter.
 - OR manually, it will be in the “Documents and Settings\Username\SendTo”.

2. Find the Reflector DLL:
- This is wherever you decided to put the Reflector DLL. I have mine in a Reflector folder under Program files.

3. Right Click drag into the SendTo folder. Click “create shortcut here” and you’re done!