IaC Practice
CtrlK
Powershell
Powershell
  • Introduction
    • History
    • Design
    • Using Powershell
    • Execution Policy
    • PowerShell Gallery
  • Install PowerShell 7
    • Visual Studio Code
    • Tests
    • Finally
  • Coding in PowerShell
    • Creating a module
    • Variables
      • Example
    • Types
    • Conditional Branching
      • if and elseif
      • Switch
    • Loops
      • For loop
      • ForEach
      • While
      • Do Until
    • Piping Commands
  • Remote Control
    • Remoting
    • Build
      • DHCP
    • Creating Users
  • Configuration at Scale
    • Desired State Configuration
    • DSC Example
    • MOF File
    • Apply the Configuration
    • Testing
    • Remove the Configuration
    • Finally
Powered by GitBook
On this page
  1. Coding in PowerShell
  2. Variables

Example

Below I do a simple tax calculation.

$NET = 111
$VAT = 0.23
$VATAMOUNT = $amount * $VAT
$GROSS = $NET + $VATAMOUNT
$text = "The total €$GROSS is the sum of the net value €$amount with the VAT amount €$VATAMOUNT at $VAT% VAT rate"
$text
PreviousVariablesNextTypes

Last updated 1 year ago