top of page

OUR PRECONDITIONS

  • The old network infrastructure, referred to as OldNet:
    Doesn’t support 802.1x.
    Two domains on different VLAN’s with a one way trust, referred to as Enterprise and Educational.
    The two domains have their own network infrastructure, different IP Helpers, DNS, DHCP and so on.

  • The new infrastructure, referred to as NewNet:
    802.1x is required using CISCO ISE and Layer 3 switches.
    Only one fallback net with its own IP range, common for both domains, which also supports WebAuth guest access.
    The two domains still have their own IP range, DHCP, DNS etc. but will use the same PXE-server since PXE boot is taking place on the fallback network.

  • Both the old and the new network infrastructure will be used to deploy Windows 10 x64 and Windows 7 x86.

  • MAB will not be used during OSD, the network team don’t want to spread a special OSD VLAN so clients will get an IP address according to its current location and only certificate-based authentication is allowed.

  • The task sequence needs to support both the new computer and refresh scenario as well as BIOS to UEFI conversion regardless of the currently installed operating system.
    The scripts used for managing 802.1x needs to support Windows 7 and its PowerShell version.

Search
Writer's picturesomeguy100

Continue to run code after ShowDialog using powershell

This is a combination of multiple stuff that I’ve found online. What I’ve done is combining, adapting and made functions out of them. https://www.dev4sys.com/2016/06/powershellwpf-part-iii-how-to-load.html https://smsagent.blog/2017/08/24/a-customisable-wpf-messagebox-for-powershell/ https://mahapps.com/

And just to make it clear, this code is a concept one, I’ve excluded stuff in some of the functions on purpose.

So, one of the things that took a lot of my time doing this was to figuring out that if you’re adding an object after the XAML is loaded, you also need to register it. As with the TextBlock object in this example: $TextBlock.RegisterName("TextBlock1",$TextBlock) Else you won’t be able to invoke changes to it and you might get errors like: “Exception calling "Invoke" with "1" argument(s): "The property 'Text' cannot be found on this object. Verify that the property exists and can be set."

I’ve also tried to find a way to make a function that can be called from within another function and that executes the calling function again using Dispatcher.Invoke. Unsuccessfully so far though.

Works:

Function run2 ($strCommand)

{

$ret=Invoke-Expression $strCommand

write-host $ret

if ($ret -contains 444)

{

write-host "444"

$d=$hash.Window.Dispatcher.Invoke(

{

try

{ ChangeTextBlock -BlockName "TextBlock1" -Text "Run2" –DynColor AliceBlue

}

catch

{

write-host $_

}

}

),

"Normal"

}

}

Doesn’t Work: Function Run3 ($strCommand)

{

$ret=Invoke-Expression $strCommand

write-host $ret

if ($ret -contains 444)

{

write-host "444"

$d=$hash.Window.Dispatcher.Invoke(

{

try

{

Invoke-Expression -Command "$strCommand" -ErrorAction SilentlyContinue

}

catch

{

write-host $_

}

}

),

"Normal"

}

}

Run3 'ChangeTextBlock -BlockName "TextBlock1" -Text "Run3" -DynColor AliceBlue' | Out-Null



818 views0 comments

Comments


bottom of page