powershell help

Welcome Forums General PowerShell Q&A powershell help

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
5 years, 2 months ago.

  • Author
    Posts
  • #13069

    Participant
    Points: 0
    Rank: Member

    I am new to Powershell and am stuck on a script I need to do using parameter(). Here is the question:

    This script will take the user's name and 3 separate grades. It will then average the
    grades and print the result. This script should do the following:
    1. Using the param() function, accept 4 command-line inputs to the script and name
    them $name, $test1, $test2, $test3.
    2. Calculate the average grade and set it equal to a variable called $average
    3. Print the message "The test average for name is average". Use interpolation to
    print the actual name and numeric average in the message.
    4. Test the script a few times with different data

    Thanks.

  • #13070

    Keymaster
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero


    param($name,$test1,$test2,$test3)
    $average = $test1 + $test2 + $test3 / 3
    write "Grade for $name is $average"

The topic ‘powershell help’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort