Powershell Super basics


<#
This script calculates the sum of numbers from 1 to 10.
It uses a for loop to iterate through the numbers and
accumulates the total in a counter variable.
#>

# Initialize variable
$counter = 0

# Loop through numbers 1 to 10
for ($i = 1; $i -le 10; $i++) {
    $counter += $i
}

# Output the result
Write-Output $counter

Use this github for some sample code


#*******************************************************
# Config Functions
#*******************************************************

# Initialize variable
$counter = 0

# Loop through numbers 1 to 10
for ($i = 1; $i -le 10; $i++) {
    $counter += $i  # Add current number to counter
}

# Output the result
Write-Output $counter

update-help

# make sure to run powershell in admin mode
  1. without this get-help shows only basic help
  2. This will include:
  3. examples
  4. broader description
  5. online help
  6. technical info etc.
  7. Note: It seem to fail for some modules, even when I run it as an admin