< Back

Invoke-Equation

Mon Jan 13, 2020 7:39 pm

NAME Invoke-Equation



SYNOPSIS

Invokes a PowerShell script for an equation





SYNTAX

Invoke-Equation [[-Step] <ScriptBlock[]>] [[-EquationName] <String>] [[-WaitBetweenStep] <TimeSpan>]

[<CommonParameters>]





DESCRIPTION

Writes a PowerShell script for an equation.

To make sure that this is safe, you can only do the following things inside of a script.



Use static methods from the [Math] class.

Use constant numbers

Use the following operators

'=','+', '-','-lt', '*', '-gt','-lt', '-ge','-le', '-ne', '-eq', '%', '/'





PARAMETERS

-Step <ScriptBlock[]>

The list of steps. Each step's comments will become



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EquationName <String>

The name of the equation. If not directly set, the equation name will become the name of the parent function



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WaitBetweenStep <TimeSpan>

If set, waits this amount of time between each step



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Invoke-Equation -Step {



# Square A

$aSquared = $a * $a

# Square B

$bSquared = $b * $b

# Get the square root of the values

[Math]::Sqrt($aSquared + $bSquared)

}











RELATED LINKS