Comments (4)
Option 3: Prompt for action. An old school text menu will work just fine for this.
$Title = "Address Hash algorithm detected!"
$Caption = @"
A pre-requisite check has failed. The Address Hash algorithm is not supported in SET.
The Microsoft recommendation is to switch to the Hyper-V Port algorithm.
Please quit if testing is needed before converting to Hyper-V Port.
S - Switch to Hyper-V Port
Q - Quit
Select a choice:
"@
$coll = @()
#$coll = New-Object System.Collections.ObjectModel.Collection
$a = [System.Management.Automation.Host.ChoiceDescription]::new("&S - Switch to Hyper-V Port")
$a.HelpMessage = "Proceed with the script, and use the recommended Hyper-V Port load balancing algorithm."
$coll+=$a
$b = [System.Management.Automation.Host.ChoiceDescription]::new("&Q - Quit")
$b.HelpMessage = "Quit the script so Hyper-V Port can be tested first."
$coll+=$b
$result = $host.ui.PromptForChoice($Title, $Caption, $coll, 0)
switch ($result) {
0 {
Write-Output "Switching to Hyper-V Port mode."
$lbAlgorithm = "Hyper-V Port"
}
1 {
Write-Warning "A pre-requisite check has failed. The Address Hash algorithm is not supported in SET."
break
}
}
from convert-lbfo2set.
I would recommend using Pester to do validation. It will greatly simply your code writing as the framework is simple and standard. It boils everything you wrote above into about 3 or 4 lines of code (no seriously).
I also think there will be more of these, so I suggest we run a prerequisite validation test with pester, then the migration, then a post-validation test to verify everything is the way it's supposed to be. Something like (Syntax and properties is not exact):
It "Should not use the address hash algorithm" {
(Get-NetLBFOTeam).Algorithm | Should not be "Address Hash"
}
<>
It "Should be Hyper-V Port or Dynamic" {
(Get-VMSwitchTeam).Algorithm | Should be "Hyper-V Port" -or "Dynamic"
}
from convert-lbfo2set.
That Pester code is slick. I need to figure out how to use that.
if -EnableBestPractices is set then I say we change to Hyper-V Port, as this is the best practice. Otherwise fail in the pre-req check.
from convert-lbfo2set.
Yes, agreed. Do you want to give that a shot after we complete the host vNIC migration binary? Here's where the existing prereq code is, and i'm sure you could figure this out with the example!
from convert-lbfo2set.
Related Issues (17)
- Check for the module when running the module does not appear to validate anything HOT 1
- Testing the Network Card Member count on LBFO Team
- Persist the vlan configuration when convert LBFO to SET
- Source code for nicReconnect1/5 HOT 1
- Made a mess of the hyper-v server I ran it on... UPDATE the video in the WIKI and install instructions. HOT 1
- Video for updating VMM is set to private link.
- This version of Windows is not yet certified for Convert-LBFO2SET HOT 2
- Script does not work with Pester v5 HOT 4
- LACP (Switch Dependent) HOT 1
- EnableBestPractices should enable vNIC best practices as well HOT 2
- Build should check that -SETTeam param exists
- Invalid $NetAdapterNames possible HOT 1
- LBFOTeam should accept the LBFO vSwitch with the same name HOT 1
- Remove-Variable should silently continue HOT 1
- EnableBestPractices should errorAction SilentlyContinue if the adapters doesn't contain the properties
- PowerSHell exits and does not detect OS version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from convert-lbfo2set.