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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.