[Tip] Managing chassis types.
Published: February 4, 2020 - 11:43 AM
Hello everyone,
I needed to restrict the installation of certain packages to laptops.
So I implemented this code:
The different chassis versions are designed to cover all variations of laptop PCs.
The list of chassis, for modifying the code, is here: https://docs.microsoft.com/en-us/window ... menclosure
The package is still installed on all machines, but the software only on the chosen chassis types.
If this can help
I needed to restrict the installation of certain packages to laptops.
So I implemented this code:
Code: Select all
CommandChassis = 'wmic systemenclosure get chassistypes'
Chassis = str(run(CommandChassis))
def install():
print('installing tls-pulse-secure')
if Chassis.find('8') != -1 or Chassis.find('9') != -1 or Chassis.find('10') != -1:
run ()
print ('Installé')
else :
print ('Ce n\'est pas un PC Portable')The list of chassis, for modifying the code, is here: https://docs.microsoft.com/en-us/window ... menclosure
The package is still installed on all machines, but the software only on the chosen chassis types.
If this can help