<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.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>More tales from the weekend of PowerShell: a bit of a horror story</title><link>http://blogs.technet.com/b/jamesone/archive/2007/09/13/more-tales-from-the-weekend-of-powershell-a-bit-of-a-horror-story.aspx</link><description>I mentioned my weekend of PowerShell , and that I've been working on scripts for the Office Communications Server 2007 resource kit. One of the things we learnt in Live Communications Server 2005 was that TLS certificates caused a lot of grief either</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>PowerShell and Telnet.</title><link>http://blogs.technet.com/b/jamesone/archive/2007/09/13/more-tales-from-the-weekend-of-powershell-a-bit-of-a-horror-story.aspx#1985208</link><pubDate>Tue, 18 Sep 2007 16:20:41 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1985208</guid><dc:creator>James O'Neill's blog </dc:creator><description>&lt;p&gt;I've got a backlog of posts at the moment. Steve and I have been getting ready for the Road-show, and&lt;/p&gt;
&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1985208" width="1" height="1"&gt;</description></item><item><title>re: More tales from the weekend of PowerShell: a bit of a horror story</title><link>http://blogs.technet.com/b/jamesone/archive/2007/09/13/more-tales-from-the-weekend-of-powershell-a-bit-of-a-horror-story.aspx#1956009</link><pubDate>Fri, 14 Sep 2007 16:36:19 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1956009</guid><dc:creator>/\/\o\/\/</dc:creator><description>&lt;p&gt;Some remarks :&lt;/p&gt;
&lt;p&gt;-f is an operator in PowerShell it wraps the statatic method on a string :&lt;/p&gt;
&lt;p&gt;PoSH&amp;gt; [string]::Format('{0}','a')&lt;/p&gt;
&lt;p&gt;a&lt;/p&gt;
&lt;p&gt;You can use the following method to format a double digit hex string :&lt;/p&gt;
&lt;p&gt;PoSH&amp;gt; &amp;quot;{0:x2}&amp;quot; -f 1&lt;/p&gt;
&lt;p&gt;01&lt;/p&gt;
&lt;p&gt;for reference :&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/dwhawy9k"&gt;http://msdn2.microsoft.com/en-us/library/dwhawy9k&lt;/a&gt;(VS.71).aspx&lt;/p&gt;
&lt;p&gt;For access to classes and remote WMI access you can use the type exelerators using direct path :&lt;/p&gt;
&lt;p&gt;PoSH&amp;gt; [wmiclass]'\\server\root\cimv2:Win32_Share'&lt;/p&gt;
&lt;p&gt;Win32_Share&lt;/p&gt;
&lt;p&gt;PoSH&amp;gt; [wmi]'\\server\root\cimv2:Win32_Share.Name=&amp;quot;PoSH&amp;quot;'&lt;/p&gt;
&lt;p&gt;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; Path &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Description&lt;/p&gt;
&lt;p&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;-----------&lt;/p&gt;
&lt;p&gt;PoSH &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\PowerShell &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PowerShell&lt;/p&gt;
&lt;p&gt;Or you can use .NET directly :&lt;/p&gt;
&lt;p&gt;new-object management.managementobject&lt;/p&gt;
&lt;p&gt;where you also can use s scope as a helper&lt;/p&gt;
&lt;p&gt;New-Object System.Management.ManagementScope&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IsConnected Options &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Path&lt;/p&gt;
&lt;p&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; ----&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; False System.Management.Connec... \\.\root\cimv2&lt;/p&gt;
&lt;p&gt;h.t.h.&lt;/p&gt;
&lt;p&gt;Greetings /\/\o\/\/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1956009" width="1" height="1"&gt;</description></item></channel></rss>