Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

What irritates you the most about how others handle conflict? Why?

Answered: 1 week ago

Question

7. Where Do We Begin?

Answered: 1 week ago

Question

a. What is the purpose of the team?

Answered: 1 week ago