Snippets/Loop/do-while.snippets.ps1xml
<?xml version='1.0' encoding='utf-8' ?>
<Snippets xmlns='http://schemas.microsoft.com/PowerShell/Snippets'> <Snippet Version='1.0.0'> <Header> <Title>do...while</Title> <Description>loop with exit condition. Loops while condition is met.</Description> <Shortcut>do</Shortcut> <Keywords>scriptblock</Keywords> <Author>ISESteroids</Author> <DifficultyLevel>2</DifficultyLevel> <Example>False</Example> <SnippetTypes> <SnippetType>Expansion</SnippetType> <SnippetType>SurroundsWith</SnippetType> <SnippetType>Refactor</SnippetType> </SnippetTypes> <Requirements> <MinimumPowerShellVersion>1</MinimumPowerShellVersion> <RequiredModules></RequiredModules> <AdminPrivileges>False</AdminPrivileges> <ProcessorArchitecture>x86,x64</ProcessorArchitecture> </Requirements> </Header> <Declarations> <Literal> <ID><![CDATA[9;29;0]]></ID> <Default></Default> <ToolTip><![CDATA[]]></ToolTip> <ToolTipStatusbar><![CDATA[code to repeat]]></ToolTipStatusbar> <EncloseSelection>true</EncloseSelection> <SupportsSurroundsWith>true</SupportsSurroundsWith> </Literal> <Literal> <ID><![CDATA[50;2;0;50;2;10;2]]></ID> <Default></Default> <ToolTip><![CDATA[]]></ToolTip> <ToolTipStatusbar><![CDATA[result to check]]></ToolTipStatusbar> </Literal> <Literal> <ID><![CDATA[54;7;0]]></ID> <Default></Default> <ToolTip><![CDATA[]]></ToolTip> <ToolTipStatusbar><![CDATA[comparison operator]]></ToolTipStatusbar> </Literal> <Literal> <ID><![CDATA[62;9;0]]></ID> <Default></Default> <ToolTip><![CDATA[]]></ToolTip> <ToolTipStatusbar><![CDATA[value to compare against]]></ToolTipStatusbar> </Literal> </Declarations> <Code> <Script Language='PowerShell' CaretOffset='74'> <![CDATA[do { $ip = Read-Host 'Enter IPv4:' } while ($ip -notlike '*.*.*.*') ]]> </Script> </Code> </Snippet> </Snippets> |