en-US/MyNumber-help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Convert-MyNumber</command:name> <command:verb>Convert</command:verb> <command:noun>MyNumber</command:noun> <maml:description> <maml:para>Convert a numeric value.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Convert a numeric value to the specified format. The result will be a string.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Convert-MyNumber</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>A numeric value to be converted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double</command:parameterValue> <dev:type> <maml:name>Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ToBinary</maml:name> <maml:description> <maml:para>Convert the number to a binary string</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Convert-MyNumber</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>A numeric value to be converted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double</command:parameterValue> <dev:type> <maml:name>Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ToHex</maml:name> <maml:description> <maml:para>Convert the number to a hex string</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Convert-MyNumber</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>A numeric value to be converted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double</command:parameterValue> <dev:type> <maml:name>Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ToOctal</maml:name> <maml:description> <maml:para>Convert the number to an Octal string</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>A numeric value to be converted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double</command:parameterValue> <dev:type> <maml:name>Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ToBinary</maml:name> <maml:description> <maml:para>Convert the number to a binary string</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ToHex</maml:name> <maml:description> <maml:para>Convert the number to a hex string</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ToOctal</maml:name> <maml:description> <maml:para>Convert the number to an Octal string</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Double</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> Convert-MyNumber 123 1111011</dev:code> <dev:remarks> <maml:para>The default behavior is to convert to binary.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> 1024678 | Convert-MyNumber -ToHex fa2a6</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code>PS C:\> 1024678 | Convert-MyNumber -ToOctal 3721246</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://bit.ly/3tBattC</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-MyNumber</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-MyNumber</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-MyNumber</command:name> <command:verb>New</command:verb> <command:noun>MyNumber</command:noun> <maml:description> <maml:para>Create a MyNumber object.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This command will create a MyNumber object based on the numeric value.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-MyNumber</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>Enter a numeric value.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double[]</command:parameterValue> <dev:type> <maml:name>Double[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CustomScriptBlock</maml:name> <maml:description> <maml:para>You can specify a custom script block that can be used to calculate a custom value. You should use a script block with a parameter indicating the current number. When the scrip tblock is executed the number value is passed as an argument. See examples.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>Enter a numeric value.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double[]</command:parameterValue> <dev:type> <maml:name>Double[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CustomScriptBlock</maml:name> <maml:description> <maml:para>You can specify a custom script block that can be used to calculate a custom value. You should use a script block with a parameter indicating the current number. When the scrip tblock is executed the number value is passed as an argument. See examples.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Double[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>MyNumber</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> New-MyNumber 123 Number : 123 Square : 15129 Cube : 1860867 Sqrt : 11.0905365064094 Log : 4.81218435537242 Sine : -0.459903490689591 Cosine : -0.887968906691855 Tangent : 0.517927471585655 CircleArea : 47529.15525616 Inverse : 0.00813008130081301 IsEven : False IsPrime : False Exp : 2.61951731874906E+53 Factorial : 1.21463043670253E+205 Factors : {1, 3, 41, 123} Custom : 0</dev:code> <dev:remarks> <maml:para>Note that the CircleArea value is calculated assuming that your number is the radius.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> 1..10 | New-MyNumber | Where IsEven | Select Number,Square,Cube Number Square Cube ------ ------ ---- 2 4 8 4 16 64 6 36 216 8 64 512 10 100 1000</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code>PS C:\> New-MyNumber 77 -CustomScriptBlock {Param($x) [char][int]$x } Number : 77 Square : 5929 Cube : 456533 Sqrt : 8.77496438739212 Log : 4.34380542185368 Sine : 0.999520158580731 Cosine : -0.0309750317312165 Tangent : -32.2685757759344 CircleArea : 18626.5028431339 Inverse : 0.012987012987013 IsEven : False IsPrime : False Exp : 2.75851345452317E+33 Factorial : 1.45183092028286E+113 Factors : {1, 7, 11, 77} Custom : M</dev:code> <dev:remarks> <maml:para>Here is an example using a custom script block. You should include a parameter in your script block for the number value.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://bit.ly/3vbXgb0</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-MyNumber</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Set-MyNumber</command:name> <command:verb>Set</command:verb> <command:noun>MyNumber</command:noun> <maml:description> <maml:para>Modify a MyNumber object.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Use this command to update a MyNumber object with a new value.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Set-MyNumber</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>A MyNumber object.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">MyNumber</command:parameterValue> <dev:type> <maml:name>MyNumber</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The new value for the Number value.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double</command:parameterValue> <dev:type> <maml:name>Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Set-MyNumber</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>A MyNumber object.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">MyNumber</command:parameterValue> <dev:type> <maml:name>MyNumber</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CustomScriptBlock</maml:name> <maml:description> <maml:para>You can specify a custom script block that can be used to calculate a custom value. You should use a script block with a parameter indicating the current number. When the script block is executed the number value is passed as an argument. See examples.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Number</maml:name> <maml:description> <maml:para>A MyNumber object.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">MyNumber</command:parameterValue> <dev:type> <maml:name>MyNumber</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The new value for the Number value.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Double</command:parameterValue> <dev:type> <maml:name>Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CustomScriptBlock</maml:name> <maml:description> <maml:para>You can specify a custom script block that can be used to calculate a custom value. You should use a script block with a parameter indicating the current number. When the script block is executed the number value is passed as an argument. See examples.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>MyNumber</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>MyNumber</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $x = New-MyNumber 52 PS C:\> $x Number : 52 Square : 2704 Cube : 140608 Sqrt : 7.21110255092798 Log : 3.95124371858143 Sine : 0.986627592040485 Cosine : -0.162990780795705 Tangent : -6.05327238279284 CircleArea : 8494.8665353068 Inverse : 0.0192307692307692 IsEven : True IsPrime : False Exp : 3.83100800071658E+22 Factorial : 8.06581751709439E+67 Factors : {1, 2, 4, 13...} Custom : 0 PS C:\> $x | Set-MyNumber -value 111 Number : 111 Square : 12321 Cube : 1367631 Sqrt : 10.5356537528527 Log : 4.70953020131233 Sine : -0.864551448610608 Cosine : -0.502544319145385 Tangent : 1.72034866513036 CircleArea : 38707.5630848798 Inverse : 0.00900900900900901 IsEven : False IsPrime : False Exp : 1.60948706696152E+48 Factorial : 1.76295255109024E+180 Factors : {1, 3, 37, 111} Custom : 0</dev:code> <dev:remarks> <maml:para>Assign a new value to the MyNumber object.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> $x | Set-MyNumber -CustomScriptBlock {param($x) ($x/365)*100 -as [int]} Number : 52 Square : 2704 Cube : 140608 Sqrt : 7.21110255092798 Log : 3.95124371858143 Sine : 0.986627592040485 Cosine : -0.162990780795705 Tangent : -6.05327238279284 CircleArea : 8494.8665353068 Inverse : 0.0192307692307692 IsEven : True IsPrime : False Exp : 3.83100800071658E+22 Factorial : 8.06581751709439E+67 Factors : {1, 2, 4, 13...} Custom : 14</dev:code> <dev:remarks> <maml:para>Set a custom scrip block. You should include a parameter in your script lock for the number value.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://bit.ly/3tFQx8Q</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-MyNumber</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Convert-MyNumber</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |