<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx</link><description>REI recently posted some comments/requests about Windows PowerShell syntax at: 
 http://blogs.msdn.com/powershell/archive/2006/04/25/583273.aspx#675133 
 Let's go through a few of the points. 
 
 ...the syntax was just way too cryptic and unintuitive</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#8116815</link><pubDate>Sun, 09 Mar 2008 12:19:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8116815</guid><dc:creator>Greg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have also a problem with powershell :)&lt;/p&gt;
&lt;p&gt;Concerning regular expression, here is my code: &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;$objEntry = [ADSI]''&lt;/p&gt;
&lt;p&gt;foreach ($objOU in $objEntry.psbase.Children)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;if ($objOU.Name -match &amp;quot;^(\w+)$&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$matches[0]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I try to get all organizational unit with matching the regular expression.&lt;/p&gt;
&lt;p&gt;In that case, variable $matches is not populated. What's append ? How can i fix the problem ?&lt;/p&gt;
&lt;p&gt;Thx !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8116815" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#2503195</link><pubDate>Wed, 09 May 2007 16:26:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2503195</guid><dc:creator>Mike Blake-Knox</dc:creator><description>&lt;p&gt;I ran into this article while looking for a description of PowerShell expression syntax. Where is the expression documentation mentioned (several times) above?&lt;/p&gt;
&lt;p&gt;It would be REALLY nice if it happened to be a complete PowerShell reference (included, for example, a description of begin/process/end statement blocks.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2503195" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#2099152</link><pubDate>Thu, 12 Apr 2007 15:56:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2099152</guid><dc:creator>halr9000</dc:creator><description>&lt;p&gt;I have a question on how/why you guys chose the syntax for comparision and logical operators. &amp;nbsp;(I'm quoting the quick reference guide that comes with 1.0.)&lt;/p&gt;
&lt;p&gt;I'd much rather use:&lt;/p&gt;
&lt;p&gt;if a==b {}&lt;/p&gt;
&lt;p&gt;then:&lt;/p&gt;
&lt;p&gt;if a -eq b {}&lt;/p&gt;
&lt;p&gt;And you support ! for not, but not &amp;amp;&amp;amp; and || for &amp;quot;and&amp;quot; and &amp;quot;or&amp;quot;, respectively? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;And along the same lines, why did you choose &amp;quot;`&amp;quot; (backquote) to escape characters, rather than the more common &amp;quot;\&amp;quot;?&lt;/p&gt;
&lt;p&gt;I'm a sysadmin, not a programmer, and I don't like having to memorize all these inconsistencies. &amp;nbsp;(Comparing command shell scripts, vbscript, jscript, etc.)&lt;/p&gt;
&lt;p&gt;Thanks for the great work though, I do appreciate the new features.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2099152" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#706816</link><pubDate>Sat, 19 Aug 2006 03:15:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:706816</guid><dc:creator>Jeffrey Snover</dc:creator><description>&amp;gt; thank you so much for listening to user concerns and responding. &lt;br&gt;&lt;br&gt;You guys are the customers. &amp;nbsp;Talk and we'll listen. &amp;nbsp;&lt;br&gt;We want you to be the happiest campers in the forest. &amp;nbsp;:-)&lt;br&gt;&lt;br&gt;Jeffrey Snover [MSFT]&lt;br&gt;Windows PowerShell/Aspen Architect&lt;br&gt;Visit the Windows PowerShell Team blog at: &amp;nbsp; &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;&lt;br&gt;Visit the Windows PowerShell ScriptCenter at: &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=706816" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#706741</link><pubDate>Sat, 19 Aug 2006 02:31:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:706741</guid><dc:creator>Michael</dc:creator><description>Having suffered from the same problems as James, it's good to hear that you're working on it. I just want to say that so far PowerShell is really great and thank you so much for listening to user concerns and responding.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=706741" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#699840</link><pubDate>Mon, 14 Aug 2006 20:36:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:699840</guid><dc:creator>PowerShell Team</dc:creator><description>Hi James;&lt;br&gt;&lt;br&gt;We are aware of some pretty big usability issues with special characters in the current release. &amp;nbsp;We've spent a lot of time improving PowerShell in this area since then, which you should see in the next drop.&lt;br&gt;&lt;br&gt;Lee&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=699840" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#686413</link><pubDate>Wed, 02 Aug 2006 16:19:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:686413</guid><dc:creator>James</dc:creator><description>I thought I'd provide an example of the problem. In an empty directory, try this:&lt;br&gt;&lt;br&gt; &amp;nbsp; new-item [test] -type file&lt;br&gt; &amp;nbsp; get-childitem | remove-item&lt;br&gt;&lt;br&gt;The file [test] is not deleted. Of course, in this case, remove-item * is an acceptable substitute, but in my case I had 'where-item' in the pipeline (and I was actually trying to archvie the items somewhere safe).&lt;br&gt;&lt;br&gt;It was a surprise to find that a pipe of objects wasn't equivalent to specifying those same objects with wildcards. A lot of programs use suffixes like [1] on filenames, and this is causing me problems.&lt;br&gt;&lt;br&gt;Another observation. If you try:&lt;br&gt; &amp;nbsp; move-item -path * -destination newname&lt;br&gt;&lt;br&gt;You get the error:&lt;br&gt; &amp;nbsp; Move-Item : Cannot move item because item at 'Some\Path\[test]' does not exist.&lt;br&gt;&lt;br&gt;Hm. I'm stuck.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=686413" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#680266</link><pubDate>Thu, 27 Jul 2006 17:08:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:680266</guid><dc:creator>James</dc:creator><description>I encountered a problem with the globbing syntax that I couldn't solve. Filenames containing [] characters are almost impossible to manipulate because the names are treated as regular expressions. I'm not trying to match a character class: the filename really contains square brackets.&lt;br&gt;&lt;br&gt;The worst thing is that often such mistakes are completely silent: some files just don't get processed. It's really quite dangerous.&lt;br&gt;&lt;br&gt;After wasting two hours by constructing various alternatives involving pipelines to try to prevent interpretation of strings as filespecs, of trying to escape the filenames before they're interpreted, and of reading documentation to try to find a way of avoiding wildcard expansion, I gave up with PowerShell and haven't used it since. I'd be really interested in knowing the solution, though.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=680266" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#679298</link><pubDate>Wed, 26 Jul 2006 21:43:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:679298</guid><dc:creator>PowerShell Team</dc:creator><description>Assign $args to a local variable and use it:&lt;br&gt;&lt;br&gt;Function GetPIDS &lt;br&gt;{ &lt;br&gt; $x = $args&lt;br&gt; $pids = [xml] (Get-Content \\NDISDEV\Data$\AdminTools\Pids.xml) &lt;br&gt; $pids.Product_Keys.PID | where {$_.Name -like $x[0]} | Format-Table Name,Key &lt;br&gt;} &lt;br&gt;&lt;br&gt;Jeffrey Snover [MSFT]&lt;br&gt;Windows PowerShell/Aspen Architect&lt;br&gt;Visit the Windows PowerShell Team blog at: &amp;nbsp; &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;&lt;br&gt;Visit the Windows PowerShell ScriptCenter at: &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=679298" width="1" height="1"&gt;</description></item><item><title>re: Issues with Windows PowerShell syntax</title><link>http://blogs.msdn.com/b/powershell/archive/2006/07/23/issues-with-windows-powershell-syntax.aspx#679290</link><pubDate>Wed, 26 Jul 2006 21:37:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:679290</guid><dc:creator>PowerShell Team</dc:creator><description>This is a bug. If you assign $args to another variable like&lt;br&gt;&lt;br&gt;$myargs = $args&lt;br&gt;&lt;br&gt;and then use that variable in the scriptblock &amp;nbsp;instead of $args it should work ok. What's happening is that where-object invokes the scriptblock with $sb.Invoke() so $args is reset in the scriptblock.&lt;br&gt;&lt;br&gt;-bruce&lt;br&gt;&lt;br&gt;Bruce Payette [MSFT]&lt;br&gt;PowerShell Technical Lead&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=679290" width="1" height="1"&gt;</description></item></channel></rss>