Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PowerShell Questions Create an Array with multiple integer entries and Find the

ID: 3743293 • Letter: P

Question

PowerShell Questions

Create an Array with multiple integer entries and Find the least integer value in array.

Invoke a notepad from powershell console and kill the same process from console.

Create class and two properties inside class- Write a method to concatenating two strings into one string. Create Object and print the method output.

Create ArrayList and sort the values with Alphabetical and in descending order. Clone into new object and find the least chars item.

Print the Registries in your machine at path "SOFTWAREMicrosoft"

Explanation / Answer

Question 1

$arr = 15,36,44,53,6,79,89,52

$i = 0

$pos = 0

$minval = [int]::MaxValue

$arr | % { if ($minval -gt $_) {$minval = $_; $pos = $i}; $i++ }

"Minimum Value is $minval"

Question 2

Start-Process 'C:windowssystem32 otepad.exe'

Stop-Process -Name "notepad"

Question 3

class test

{

    [string]$s1

    [string]$s2

    [string]$s3

    testjoin ()

    {

        $s3=$s1+$s2

        "New String $s3"

    }

}

For calling

$obj=New-Object test

$obj.testjoin()

Question 4

Get-ChildItem -path HKLM:SOFTWARE

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote