Commit 5f0e6194 authored by Lonlone Lee's avatar Lonlone Lee

Updated scripts to minimize prompts and inprove functionatlity

parent ff3f2321
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
#Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
#Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true
###############
# These are the values you should get from your webform
......@@ -24,7 +25,7 @@ Import-Csv -Path $fileName -UseCulture | %{
$vm = Get-VM -Name $VMName
$snapshot = Get-Snapshot -VM $vm -Name $snapName
Remove-Snapshot -Snapshot $snapshot -Confirm $false
Remove-Snapshot -Snapshot $snapshot -Confirm:$false
}
}
......
#Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
#Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true
Connect-VIServer -Server pgvcenter.stanford.edu
#(Get-View ScheduledTaskManager).ScheduledTask | %{ (Get-View $_).Info } | Export-Csv -Path C:\temp\GetScheduledTasks.csv -NoTypeInformation -UseCulture
(Get-View ScheduledTaskManager).ScheduledTask | %{ (Get-View $_).Info } | Select Name,Description,TaskObject,Enabled,State,NextRunTime | Export-Csv -Path C:\temp\GetScheduledTasks.csv -NoTypeInformation -UseCulture
Disconnect-VIServer -Server pgvcenter.stanford.edu -Confirm:$false
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
#Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
#Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true
Connect-VIServer -Server pgvcenter.stanford.edu
......
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
Connect-VIServer -Server pgvcenter.stanford.edu
$task = ((Get-View ScheduledTaskManager).ScheduledTask | %{ (Get-View $_).Info } | Where-Object {$_.Description -eq "Winter 2019 Patching"})
$task.RemoveScheduledTask
Disconnect-VIServer -Server pgvcenter.stanford.edu
\ No newline at end of file
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
#Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm
###############
# These are the values you should get from your webform
......@@ -14,7 +14,7 @@ Connect-VIServer -Server $vcName
Import-Csv -Path $fileName -UseCulture | %{
$dateString = $_.SnapTime,$_.SnapDate -join ' '
$dateString = $_.SnapDateTime
$snapTime = Get-Date $dateString
$snapName = $_.SnapName
$snapDescription = $_.SnapDescription
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment