In: Computer Science
Using PowerShell ISE or VSCode, create a PowerShell script that will do the following:
Upload the script. Paste a screenshot of the results here
I below is the code and output screens
#we are witing functions and calling them to get desired output
#note-make sure that the running the scripts shouls be enabled in your host system
#this is the function to find usernames in the current system
function getmyusername{
$(Get-LocalUser)
}
#calling the above function
Write-Output "The username is"
getmyusername
Write-Output " "
#this is the function to find timezone
function getmytimezone{
$(Get-TimeZone)
}
#calling the above function
Write-Output "The timezone is"
getmytimezone
#this is the function to find the date
function getthedate{
#using the displayhint
$(Get-Date -DisplayHint Date)
}
#calling the above function
Write-Output "The date is"
getthedate
#this is the function to find machinename in the current system
function getmymachinename{
#using environmentvaraibles
$([system.environment]::MachineName)
}
#calling the above function
Write-Output "The machinename is"
getmymachinename