Consolidate PowerShell App Deploy Toolkit Function .PS1 Files

By | May 24, 2019
Share

1\Copy the “AppDeployToolkit” folder to your Deployment Share’s “Scripts” folder.

2\Edit the “AppDeployToolkit\AppDeployToolkitConfig.xml” file to log to MDT’s log location.

3\Update the Deploy-Application.ps1 files you use in your Application installs to locate the centrally located “AppDeployToolkit” folder.

4\Lastly, when adding your application to MDT, use this as the “Command Line”.

PowerShell.exe -ExecutionPolicy Bypass -WindowStyle Min -File Deploy-Application.ps1

This is especially helpful if you’ve created add-ons for PSADT, because all of the content is in one location.

-BG

Installing Panasonic Toughbook BIOS Updates in a Task Sequence

By | April 24, 2019
Share

First off, here are the silent arguments I’m passing to my BIOSXX.exe package:

UiMode=2 SetExitCode=1 NoShutdownInTool=1 RequiresACAndBattery=0 LogLevel=2 Log=C:\MININT\SMSOSD\OSDLOGS\BiosUpdate.log’

The important arguments are bolded. Getting these arguments together are the difficult part.

Now for the easy part.

1\Create “Applications” for each BIOS update package. In my example, I wrapped the update in a PSADT (https://psappdeploytoolkit.com/) package.

i.e. CF33S-1 https://drive.google.com/open?id=1fqhv42o8BxMRAkVJ8uO5tYG_lteQ9-th

i.e. CF33-1 https://drive.google.com/open?id=1FWKouYrA1AeRnzz3Q5nksNwG-cBcYV67

i.e. CF20-2 https://drive.google.com/open?id=1FXlqxs8rUWUn_GbwzPsNt43m8hLLNwwQ

2\Create folders for each model with a WMI query. Here is my model WMI query.

SELECT * FROM Win32_BaseBoard WHERE Product LIKE “CF33S-1%”

3\Create sub-folders for the BIOS version check. For this I used a negative like statement.

SELECT * FROM Win32_Bios WHERE NOT SMBIOSBIOSVersion LIKE “V1.50L14”

4\You must add a “Restart Computer” step to occur directly after the BIOS update is executed. During the reboot, the BIOS and EC will get flashed.

5\In the case of these updates, a driver update was also required. So I set the Deploy-Application.ps1 to install the ME driver update before attempting the update on the BIOS/EC.

Execute-Process -Path “$dirFiles\me_driver_update_v3\SetupME.exe” -Parameters ‘-s -noIMSS -nowiman -preinst’

-BG

Impressive Site Removes Background From Images

By | January 11, 2019
Share

**UPDATED:  Here is a link to the site http://remove.bg

I’ve done this a million times and it’s not fun.  This site helped me out with a recent project.  It didn’t complete the masking, but it was 90% accurate, which I can appreciate!

Check the Embedded Controller (EC) Firmware Version in Powershell

By | January 10, 2019
Share

Here is a snippet for checking the EC version.  It tosses a dialog with it’s result.

Pre-reqs:

1\This snippet uses Powershell App Deploy Toolkit functions.

https://psappdeploytoolkit.com/

2\You’ll need to place the .mof and .dll files from our WMI BIOS util in the files folder.

ftp://ftp.panasonic.com/computer/software/WMI_Release_V1.00L31.zip

 

 

## <Perform Installation tasks here>
Show-InstallationProgress -StatusMessage "Copying DLL and MOF files"
Copy-File -Path "$dirFiles\SetBIOS4Conf.dll" -Destination "$envSystem32Directory\SetBIOS4Conf.dll"
Copy-File -Path "$dirFiles\PNSNProv.dll" -Destination "$envSystem32Directory\PNSNProv.dll"
Copy-File -Path "$dirFiles\SetBIOS4Conf.mof" -Destination "$envSystem32Directory\SetBIOS4Conf.mof"
Copy-File -Path "$dirFiles\PNSNProv.mof" -Destination "$envSystem32Directory\PNSNProv.mof"
                             
Show-InstallationProgress -StatusMessage "Importing MOF files"
Execute-Process -Path "mofcomp.exe" -Parameters "$envSystem32Directory\PNSNProv.mof"
Execute-Process -Path "mofcomp.exe" -Parameters "$envSystem32Directory\SetBIOS4Conf.mof"
                             
Show-InstallationProgress -StatusMessage "Importing DLL files"
Execute-Process -Path "regsvr32.exe" -Parameters ('/s "{0}\PNSNProv.mof"' -f $envSystem32Directory) -IgnoreExitCodes 3
        
$EcVersion = (gwmi -Namespace "root\PanasonicPC" -Query "SELECT * FROM SetBIOS4Conf").ECVersion
if ($EcVersion -eq "V3.00L12") {
    Show-DialogBox -Title 'EC Version Check' -Text ('Your EC version({0}) is correct.' -f $EcVersion) -Icon 'Information'
} else {
    Show-DialogBox -Title 'EC Version Check' -Text ('Your EC version({0}) is incorrect.' -f $EcVersion) -Icon 'Exclamation'
}

/BG

 

Map A1 button on CF-20 and CF-33 to perform soft dismount from keyboard base

By | November 28, 2018
Share

This sniplet was written to work within a Powershell app deploy toolkit package.  If you are not familiar with that toolkit, get familiar with it, its a huge time saver.

## <Perform Installation tasks here>
Execute-Process -Path "$envSystem32Directory\reg.exe" -Parameters ('load HKLM\ImportedHive "{0}\Users\Default\NTUSER.dat"' -f $envSystemDrive)
$bClickDefAction = [byte[]](0x25,0x00,0x53,0x00,0x79,0x00,0x73,0x00,0x74,0x00,0x65,0x00,0x6d,0x00,0x52,0x00,0x6f,0x00,0x6f,0x00,0x74,0x00,0x25,0x00,0x5c,0x00,0x53,0x00,0x79,0x00,0x73,0x00,0x74,0x00,0x65,0x00,0x6d,0x00,0x33,0x00,0x32,0x00,0x5c,0x00,0x72,0x00,0x75,0x00,0x6e,0x00,0x64,0x00,0x6c,0x00,0x6c,0x00,0x33,0x00,0x32,0x00,0x2e,0x00,0x65,0x00,0x78,0x00,0x65,0x00,0x00,0x00,0x63,0x00,0x66,0x00,0x67,0x00,0x6d,0x00,0x67,0x00,0x72,0x00,0x33,0x00,0x32,0x00,0x2e,0x00,0x64,0x00,0x6c,0x00,0x6c,0x00,0x2c,0x00,0x43,0x00,0x4d,0x00,0x5f,0x00,0x52,0x00,0x65,0x00,0x71,0x00,0x75,0x00,0x65,0x00,0x73,0x00,0x74,0x00,0x5f,0x00,0x45,0x00,0x6a,0x00,0x65,0x00,0x63,0x00,0x74,0x00,0x5f,0x00,0x50,0x00,0x43,0x00,0x00,0x00)

Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2' -Name 'ButtonID' -Type 'Dword' -Value '2'
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction

Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2' -Name 'ButtonID' -Type 'Dword' -Value '2'
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648'
Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction

Execute-Process -Path "$envSystem32Directory\reg.exe" -Parameters 'unload HKLM\ImportedHive'