# ***************************************************************************** # Microsoft Deployment Toolkit 2010 Exported Application # By Keith S. Garner (KeithGa.com) # 7-Zip File Archiver 4.65 ( 11/4/2009 12:00:00 AM ) param( [string] $Folder = "Applications\Common Tools", [string] $DPDrive = "DS001", [string] $DPShare = "\\$env:ComputerName\DeploymentShare$", [switch] $Confirm, [switch] $Verbose, [switch] $WhatIf ) $LocalPath = split-path -parent $MyInvocation.MyCommand.Definition # ***************************************************************************** # Restore Powershell Drive Object if (!(test-path "$($DPDrive)`:\")) { Add-PSSnapin Microsoft.BDD.PSSnapIn -ErrorAction SilentlyContinue | out-null restore-MDTPErsistentDrive -Verbose:$Verbose -Confirm:$Confirm -Whatif:$Whatif |out-null if ((!(test-path "$($DPDrive)`:\")) -band (test-path $DPShare) ) { New-PSDrive -Name $DPDrive -PSProvider MDTProvider -Root $DPShare -Verbose:$Verbose -Confirm:$Confirm -Whatif:$Whatif |out-null } if (!(test-path "$($DPDrive)`:\")) { throw "$DPDrive is not Mounted and not Persisted." } } # ***************************************************************************** # Create Logical Folder on MDT Drive foreach ( $NEwPath in "$($DPDrive)`:\$Folder" ) { if(!(test-path $NewPath)) { new-item -type directory $NewPath -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose |out-null } } # ***************************************************************************** #Add Application(s) $7zipx86 = import-MDTApplication -path '$($DPDrive)`:\$Folder' -ShortName '7zipx86' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name '7-Zip File Archiver 4.65 - x86' -CommandLine 'msiexec.exe /qb- /l*vx %LogPath%\7-zip.log REBOOT=ReallySuppress UILevel=67 /i http://downloads.sourceforge.net/sevenzip/7z465.msi' -UninstallKey '{23170F69-40C1-2701-0462-000001000000}' -enable 'True' -hide 'True' -SupportedPlatform @( 'All x86 Pre-Vista', 'All x86 Vista and Newer' ) $7zipx64 = import-MDTApplication -path '$($DPDrive)`:\$Folder' -ShortName '7zipx64' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name '7-Zip File Archiver 4.65 - x64' -CommandLine 'msiexec.exe /qb- /l*vx %LogPath%\7-zip.log REBOOT=ReallySuppress UILevel=67 /i http://downloads.sourceforge.net/sevenzip/7z465-x64.msi' -UninstallKey '{23170F69-40C1-2702-0462-000001000000}' -enable 'True' -hide 'True' -SupportedPlatform @( 'All x64 Pre-Vista', 'All x64 Vista and Newer' ) $7-zip = import-MDTApplication -path '$($DPDrive)`:\$Folder' -ShortName '7-zip' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name '7-Zip File Archiver 4.65' -enable 'True' -hide 'False' -Dependency @( '$7-zip.item('guid'), $7-zip.item('guid')' ) -NoSource return $7-zip