Automated Bootloader Installation
The SetupHTBootloaderNetwork.ps1
script supports automation with a silent installation option. In keeping with the GUI installer, when used in interactive mode, this script displays the ConnectionId
and DeviceID
of the network adapter identification instead of just the hardware description.
The DeviceID
displayed is the value of the DeviceID
property of the Win32_NetworkAdapter WMI
class.
Note that value of DeviceID
is the same as the Index
property of the Win32_NetworkAdapterConfiguration
class.
To use this script in interactive mode, do not use the -silent
flag. In interactive mode, any parameters supplied to the script will be ignored.
When used in non interactive mode, using the -silent
flag, the network adapter to be configured is specified through the -deviceid
parameter (similar to /NET
in the silent installer). The script will detect current settings of the specified network adapter and use them if they are not overridden by any of the following optional parameters:
-dhcp
— Use-dhcp
for configuring the adapter. This choice overrides all other settings-ip
— IP address-netmask
— Netmask-gw
— Gateway IP address-dns
— IP address of one or more DHCP servers, separated by commas-hostname
— Hostname-domain
— Domain
If the -silent
flag is used without the -deviceid
parameter, the script will try to detect the preferred network adapter, that is, the one used to connect to the KeyControl, and configure it.
For the purpose of automation, available network adapters can be listed by using the -listadapters
parameter. The output is printed on the console. This flag overrides any other parameter.
Examples
Use -listadapters
to get available devices and parse it to figure out the value of the -deviceid
parameter you want to use. Note that the value of DeviceID
can also be found by querying the Win32_NetworkAdapter
or Win32_NetworkAdapterConfiguration
WMI classes and using the DeviceID
or Index
property of the respective classes.
PS C:\users\administrator> SetupHTBootloaderNetwork.ps1 -listadapters DeviceID|Description|IPAddress|MACAddress|DhcpEnabled|ConnectionID|Preferred 7|Intel(R) PRO/1000 MT Network Connection|172.16.14.222|00:0C:29:45:59:93|True|Local Area Connection|False 10|Intel(R) PRO/1000 MT Network Connection #2|192.168.100.34|00:0C:29:45:59:9D|False|Connection 2|False
Once the DeviceID
has been determined, specify it as the value for the -deviceid
parameter. This will configure the Bootloader to use the specified interface with its current configuration.
PS C:\users\administrator> SetupHTBootloaderNetwork.ps1 -deviceid 10 Successfully updated HT Bootloader network configuration PS C:\users\administrator> cat T:\hcs\etc\ipconfig DHCP=false IP="192.168.100.34" NETMASK="255.255.255.0" GATEWAY="" IPV4DNS0="" DNSDOMAIN=""
If you want to override any of the default configuration, specify the required value with any of the parameters documented in previous section. The following example adds Gateway
and DNS server
information.
PS C:\users\administrator> SetupHTBootloaderNetwork.ps1 -silent -deviceid 10 / -gw 192.168.100.1 -dns 192.168.100.1,192.168.1.1 Successfully updated HT Bootloader network configuration PS C:\users\administrator> cat T:\hcs\etc\ipconfig DHCP=false IP="192.168.100.34" NETMASK="255.255.255.0" GATEWAY="192.168.100.1" IPV4DNS0="192.168.100.1 192.168.1.1" DNSDOMAIN=""