Snippets/Loop/simplefor.snippets.ps1xml
<?xml version='1.0' encoding='utf-8' ?>
<Snippets xmlns='http://schemas.microsoft.com/PowerShell/Snippets'> <Snippet Version='1.0.0'> <Header> <Title>Basic "For" Loop</Title> <Description>uses iterator variable to iterate from a start value to an end value with a given increment</Description> <Shortcut>for</Shortcut> <Keywords>ScriptBlock,Editor</Keywords> <Author>Tobias</Author> <DifficultyLevel>2</DifficultyLevel> <Example>False</Example> <SnippetTypes> <SnippetType>Expansion</SnippetType> <SnippetType>SurroundsWith</SnippetType> </SnippetTypes> <Requirements> <MinimumPowerShellVersion>1</MinimumPowerShellVersion> <RequiredModules></RequiredModules> <AdminPrivileges>False</AdminPrivileges> <ProcessorArchitecture>x86,x64</ProcessorArchitecture> </Requirements> </Header> <Declarations> <Literal> <ID><![CDATA[6;1;1;5;2;16;2;30;2;59;2;85;2]]></ID> <Default></Default> <ToolTip><![CDATA[iteration variable name]]></ToolTip> <ToolTipStatusbar><![CDATA[iteration variable name]]></ToolTipStatusbar> </Literal> <Literal> <ID><![CDATA[10;4;0]]></ID> <Default></Default> <ToolTip><![CDATA[start value]]></ToolTip> <ToolTipStatusbar><![CDATA[start value]]></ToolTipStatusbar> </Literal> <Literal> <ID><![CDATA[20;2;0]]></ID> <Default></Default> <ToolTip><![CDATA[comparison operator]]></ToolTip> <ToolTipStatusbar><![CDATA[comparison operator]]></ToolTipStatusbar> </Literal> <Literal> <ID><![CDATA[23;5;0]]></ID> <Default></Default> <ToolTip><![CDATA[stop value]]></ToolTip> <ToolTipStatusbar><![CDATA[stop value]]></ToolTipStatusbar> </Literal> <Literal> <ID><![CDATA[36;3;0]]></ID> <Default></Default> <ToolTip><![CDATA[increment]]></ToolTip> <ToolTipStatusbar><![CDATA[increment]]></ToolTipStatusbar> </Literal> <Literal> <ID><![CDATA[48;45;0]]></ID> <Default></Default> <ToolTip><![CDATA[code to repeat]]></ToolTip> <ToolTipStatusbar><![CDATA[code to repeat]]></ToolTipStatusbar> <EncloseSelection>true</EncloseSelection> </Literal> </Declarations> <Code> <Script Language='PowerShell' PowerShellCaretOffset='98'> <![CDATA[for ($x = 1000; $x -lt 15000; $x += 300) { "Frequency $x Hz" [Console]::Beep($x, 500) } ]]> </Script> </Code> </Snippet> </Snippets> |