This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($volume in $VolumeList){ | |
$volumeUri = "$VMSettingsUrl/volumes/$($volume.volumeIdentifier)" | |
$currentVolume = Invoke-RestMethod -Uri $volumeUri -Method GET -TimeoutSec 100 -Headers $ZertosessionHeader -ContentType $TypeJSON | |
$currentVolume.Datastore.DatastoreIdentifier = $newVMDS.DatastoreIdentifier | |
$body = $currentVolume | Convertto-Json -depth 10 | |
$ChangeVolumeLocationRequest = Invoke-RestMethod -Uri $volumeUri -Method PUT -TimeoutSec 100 -Headers $ZertosessionHeader -ContentType $TypeJSON -Body $body | |
} #Close Volume Loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-LastCommandExecutionTime { | |
<# | |
.SYNOPSIS | |
Gets the execution time of the last command used. | |
.EXAMPLE | |
Get-LastCommandExecutionTime | |
Description | |
----------- | |
Gets the last execution time of the last command run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-Fuel ($PayloadMass) { | |
[Math]::Floor($PayloadMass / 3) - 2 | |
} | |
$PayloadMasses = Get-Content .\PayloadMasses.txt | |
$TotalRequiredFuel = 0 | |
foreach ($PayloadMass in $PayloadMasses) { | |
$TotalRequiredFuel += Get-Fuel($PayloadMass) | |
} | |
Write-Output "Total Required Fuel: $TotalRequiredFuel" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-Fuel ($PayloadMass) { | |
$RequiredFuel = [Math]::Floor($PayloadMass / 3) - 2 | |
if ($RequiredFuel -le 0) { | |
return 0 | |
} else { | |
return $($RequiredFuel + $(Get-Fuel($RequiredFuel))) | |
} | |
} | |
$PayloadMasses = Get-Content .\PayloadMasses.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-MyIp { | |
Invoke-RestMethod -Uri "https://ipinfo.io/json" | |
} | |
Function Get-LastCommandExecutionTime { | |
<# | |
.SYNOPSIS | |
Gets the execution time of the last command used. | |
.EXAMPLE | |
Get-LastCommandExecutionTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## | |
# Privacy Settings | |
################## | |
# Privacy: Let apps use my advertising ID: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# To Restore: | |
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1 | |
# Privacy: SmartScreen Filter for Store Apps: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0 |