-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathLab1.ps1
More file actions
33 lines (27 loc) · 724 Bytes
/
Lab1.ps1
File metadata and controls
33 lines (27 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$computername = $env:COMPUTERNAME
function get-computername1
{
$cn = $env:COMPUTERNAME
write-host "Your ComputerName is $cn" -ForegroundColor Red
}
"Today's Date is " + (Get-Date)
Write-Host (get-computername1)
Get-CimInstance -Classname Win32_BIOS
function get-myservice
{
[CmdletBinding()]
param (
$service
)
begin {
import-module posh-git
Write-Host "Script is now starting" -ForegroundColor Green
}
process {
$value = get-service $service | Select-Object name,Status
}
end {
Write-Host "Script has finished executing" -ForegroundColor Yellow
}
# Modify [CmdletBinding()] to [CmdletBinding(SupportsShouldProcess=$true)]
}