Question: Please help me solve this. Powershell only & please show input and output. Question: The following function attempts to accept three mandatory parameters: input file,

Please help me solve this. Powershell only & please show input and output.

Question: The following function attempts to accept three mandatory parameters: input file, list of one or more hash algorithms, and output file that saves the hash values of the input file. Your task is to complete the function by writing the code needed to efficiently and effectively implement function in the specified block. You must implement some form of looping to access the elements in $hashalgirthm.

function Return-FileHash {

param (

[Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)] [ValidateSet("SHA1","SHA256","SHA384","SHA512","MD5")]

[STRING[]]

# the array list that contains one or more hash algorithm input for Get-FileHash cmdlet

$hashAlgorithm,

[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$true)]

# the document or executable input/InputStream for Get-FileHash cmdlet

$filepath,

[Parameter(Position=2,Mandatory=$true,ValueFromPipeline=$true)]

# the output file that contains the hash values of $filepath

$hashOutput

)

Return-FileHash

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!