-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.ps1
More file actions
64 lines (43 loc) · 1.56 KB
/
example.ps1
File metadata and controls
64 lines (43 loc) · 1.56 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<#
.SYNOPSIS
This script is my scratchbook for the things that are automated more or less well.
.DESCRIPTION
Use the lines or the full script
# synchronize all images within the microcloud
Sync-MICROImage
#>
Remove-Module MicroCloud*
Import-Module "C:\Projekte\MicroCloud\Module\MicroCloud.psm1"
<#
$session = New-SSHSession -ComputerName 192.168.88.1 -Credential (Get-Credential) -Verbose
(Invoke-SSHCommand -SSHSession $session -Command "/ip address print").Output
Invoke-SSHCommand -SSHSession $session -Command "print"
Remove-SSHSession $session
#>
Clear
$start = Get-Date
Write-Output ""
Write-Output "- Retrieve an overview of available ram ressources"
$stats = Get-MICRONodeStats
$stats | Format-Table
# Accesses the "real" ressources
#Write-Output "- Grab yourself an overview of all running vms on all nodes"
#Get-MICROVM | Format-Table
Get-MicroVMIntent | Format-Table
Write-Output ""
Write-Output "- Add intents to add 18 machines..."
1..18 | ForEach-Object {
Add-MICROVMIntent -BaseImage "Basis-Windows-Server-2019-Image"
} | Format-Table
Write-Output ""
Write-Output "- Retrieve an overview of available ram ressources"
Get-MICRONodeStats | Format-Table
Write-Output ""
Write-Output "- Invoke a processing step to perform all necessary tasks on the nodes"
Invoke-MICROProcessingStep
# declare the intent to stop all micro cloud vms
Get-MICROVmIntent | Set-MICROVmIntentStop
Invoke-MICROProcessingStep
$stop = Get-Date
$durationInSeconds = ($stop-$start).TotalSeconds
Write-Output "Total duration in seconds: $durationInSeconds"