Quantcast
Channel: PowerShell App Deployment Toolkit
Viewing all 2341 articles
Browse latest View live

New Post: Block-AppExecution function....

$
0
0
Have you tried using this parameter:

.PARAMETER AllowDeferCloseApps
Enables an optional defer button to allow the user to defer the installation only if there are
 running applications that need to be closed.

New Post: Block-AppExecution function....

$
0
0
Hello

I'll have to look at the documentation more carefully.... Sorry :-(

We use this command line but we had the same issue.

Show-InstallationWelcome -CloseApps "notepad" -BlockExecution -AllowDeferCloseApps -DeferTimes "20" -CheckDiskSpace -PersistPrompt

it seems that schtasks.exe can not create a task with more than 261 characters....

Commented Unassigned: -Patch Parameter for Execute-MSI [83]

$
0
0
Could you please implement a -Patch parameter similiar to the -Transform parameter?

I do not want to override the default switches everytime ive to specify patches.

e.g For Adobe Products its not recommended to slipstream the MSPs into the main MSI.

Regards,
Fabio
Comments: Execute-MSI -Action Patch -Path "AdbeRdrUpd11009.msp"

Commented Unassigned: -Patch Parameter for Execute-MSI [83]

$
0
0
Could you please implement a -Patch parameter similiar to the -Transform parameter?

I do not want to override the default switches everytime ive to specify patches.

e.g For Adobe Products its not recommended to slipstream the MSPs into the main MSI.

Regards,
Fabio
Comments: can it handle this, too?:[0A][0A]Execute-MSI -Action Patch -Path "c:\temp\p\sccm2007ac-sp2-kb2509007-x86-icp1.msp;c:\temp\p\sccm2007ac-sp2-kb2516517-x86-icp1.msp;c:\temp\p\sccm2007ac-sp2-kb2516850-x86-icp1.msp"

Created Unassigned: New-Shorcut cmdlet fails to create .urls [86]

$
0
0
Seems the Windows scripting host can only create URL shortcuts with a TargetPath.

http://msdn.microsoft.com/en-us/library/265a4017(v=vs.84).aspx

I removed the Mandatory Parameter and added code to handle the different cases.

Function New-Shortcut {
<#
.SYNOPSIS
Creates a new shortcut .lnk or .url file, which can be used for example on the start menu.
.DESCRIPTION
Creates a new shortcut .lnk or .url file, with configurable options.
.EXAMPLE
New-Shortcut -Path "$envProgramData\Microsoft\Windows\Start Menu\My Shortcut.lnk" -TargetPath "$envWinDir\system32\notepad.exe" -IconLocation "$envWinDir\system32\notepad.exe" -Description "Notepad" -WorkingDirectory "$envHomeDrive\$envHomePath"
.PARAMETER Path
Path to save the shortcut
.PARAMETER TargetPath
Target path or URL that the shortcut launches
.PARAMETER Arguments
Arguments to be passed to the target path
.PARAMETER IconLocation
Location of the icon used for the shortcut
.PARAMETER Description
Description of the shortcut
.PARAMETER WorkingDirectory
Working Directory to be used for the target path
.PARAMETER ContinueOnError
Continue if an error is encountered
.NOTES
.LINK
Http://psappdeploytoolkit.codeplex.com
#>
Param (
[Parameter(Mandatory = $true)]
[string] $Path,
[Parameter(Mandatory = $true)]
[string] $TargetPath,
[string] $Arguments,
[string] $IconLocation,
[string] $Description,
[string] $WorkingDirectory,
[boolean] $ContinueOnError = $true
)

$PathDirectory = ([System.IO.FileInfo]$Path).DirectoryName
Try {
If (!(Test-Path -Path $PathDirectory)) {
Write-Log "Creating shortcut directory..."
New-Item -ItemType Directory -Path $PathDirectory -ErrorAction SilentlyContinue -Force | Out-Null
}
}
Catch [Exception] {
If ($ContinueOnError -eq $true) {
Write-Log $("Failed to create shortcut directory [$PathDirectory]: " + $_.Exception.Message)
}
Else {
Throw $("Failed to create shortcut directory [$PathDirectory]: " + $_.Exception.Message)
}
}


Write-Log "Creating shortcut [$path]..."
Try {
If (($path).Endswith(".url")) {
$shortcut = $shell.CreateShortcut($path)
$shortcut.TargetPath = $targetPath
$shortcut.Save()
}
If (($path).Endswith(".lnk")) {
$shortcut = $shell.CreateShortcut($path)
$shortcut.TargetPath = $targetPath
$shortcut.Arguments = $arguments
$shortcut.IconLocation = $iconLocation
$shortcut.Description = $description
$shortcut.WorkingDirectory = $workingDirectory
$shortcut.Save()
}
}
Catch [Exception] {
If ($ContinueOnError -eq $true) {
Write-Log $("Failed to create shortcut [$path]: " + $_.Exception.Message)
}
Else {
Throw $("Failed to create shortcut [$path]: " + $_.Exception.Message)
}
}

}

Commented Unassigned: New-Shorcut cmdlet fails to create .urls [86]

$
0
0
Seems the Windows scripting host can only create URL shortcuts with a TargetPath.

http://msdn.microsoft.com/en-us/library/265a4017(v=vs.84).aspx

I removed the Mandatory Parameter and added code to handle the different cases.

Function New-Shortcut {
<#
.SYNOPSIS
Creates a new shortcut .lnk or .url file, which can be used for example on the start menu.
.DESCRIPTION
Creates a new shortcut .lnk or .url file, with configurable options.
.EXAMPLE
New-Shortcut -Path "$envProgramData\Microsoft\Windows\Start Menu\My Shortcut.lnk" -TargetPath "$envWinDir\system32\notepad.exe" -IconLocation "$envWinDir\system32\notepad.exe" -Description "Notepad" -WorkingDirectory "$envHomeDrive\$envHomePath"
.PARAMETER Path
Path to save the shortcut
.PARAMETER TargetPath
Target path or URL that the shortcut launches
.PARAMETER Arguments
Arguments to be passed to the target path
.PARAMETER IconLocation
Location of the icon used for the shortcut
.PARAMETER Description
Description of the shortcut
.PARAMETER WorkingDirectory
Working Directory to be used for the target path
.PARAMETER ContinueOnError
Continue if an error is encountered
.NOTES
.LINK
Http://psappdeploytoolkit.codeplex.com
#>
Param (
[Parameter(Mandatory = $true)]
[string] $Path,
[Parameter(Mandatory = $true)]
[string] $TargetPath,
[string] $Arguments,
[string] $IconLocation,
[string] $Description,
[string] $WorkingDirectory,
[boolean] $ContinueOnError = $true
)

$PathDirectory = ([System.IO.FileInfo]$Path).DirectoryName
Try {
If (!(Test-Path -Path $PathDirectory)) {
Write-Log "Creating shortcut directory..."
New-Item -ItemType Directory -Path $PathDirectory -ErrorAction SilentlyContinue -Force | Out-Null
}
}
Catch [Exception] {
If ($ContinueOnError -eq $true) {
Write-Log $("Failed to create shortcut directory [$PathDirectory]: " + $_.Exception.Message)
}
Else {
Throw $("Failed to create shortcut directory [$PathDirectory]: " + $_.Exception.Message)
}
}


Write-Log "Creating shortcut [$path]..."
Try {
If (($path).Endswith(".url")) {
$shortcut = $shell.CreateShortcut($path)
$shortcut.TargetPath = $targetPath
$shortcut.Save()
}
If (($path).Endswith(".lnk")) {
$shortcut = $shell.CreateShortcut($path)
$shortcut.TargetPath = $targetPath
$shortcut.Arguments = $arguments
$shortcut.IconLocation = $iconLocation
$shortcut.Description = $description
$shortcut.WorkingDirectory = $workingDirectory
$shortcut.Save()
}
}
Catch [Exception] {
If ($ContinueOnError -eq $true) {
Write-Log $("Failed to create shortcut [$path]: " + $_.Exception.Message)
}
Else {
Throw $("Failed to create shortcut [$path]: " + $_.Exception.Message)
}
}

}
Comments: Interesting. What's next? .Net Application Reference shortcuts? ( Shortcut filename that ends with .appref-ms ) Too bad CodePlex ate your formatting. Should've used the __Preview__ tab. The idea is not bad. Code looks kosher. Got my vote.

New Post: copy folder incl. permissions from fileshare to program files

$
0
0
If you need it, use RoboCopy with /SecFix (see http://yakupkorkmaz.info/?p=12)

If I was the TK Devs though, I would not make it part of the the TK.
Usually you want the file to INHERIT the perms of the destination folder.

Commented Unassigned: -Patch Parameter for Execute-MSI [83]

$
0
0
Could you please implement a -Patch parameter similiar to the -Transform parameter?

I do not want to override the default switches everytime ive to specify patches.

e.g For Adobe Products its not recommended to slipstream the MSPs into the main MSI.

Regards,
Fabio
Comments: Sorry, i think i made myself unclear: You can specify a list of MSP Files directly during the initial installation: E.g: msiexec /i "mymsi.msi" TRANSFORMS="custom.mst" PATCH="MyPatch1.msp" More information: http://msdn.microsoft.com/en-us/library/aa370576(v=vs.85).aspx So i request a -Patch Parameter for the "Install" Action of "Execute-MSI". Otherwise i need to specify it with -Parameters which results in loosing of my default parameters like UI Level and so on (and i need to specify it again there). More clear now?

New Post: If statement to check for an installed application then uninstall if found.

$
0
0
I am trying to look at some of the examples and code to figure out how I can first do a check during the pre-installation stage to see if an app is installed, and if so to uninstall it.

Then I need to do an uninstall of the existing program, then perform an install of the "new" program.

Background:
Originally when the software was deployed it was supposed to uninstall the existing software, but it didn't so users now have to versions of this outlook plugin. Now they want a new version deployed, so I figured I would take this opportunity to do a check for the original and remove, then remove the existing and then install the latest version.

I am not very well versed in powershell and still learning.

The original file is an MSI so I know I can call it to uninstall, I just don't know how to do the check to see if it exists first, and if not to move on to the second uninstall string.

New Post: If statement to check for an installed application then uninstall if found.

$
0
0
There is also a Remove-MSIApplications function in the toolkit that may work for you. See the documentation for additional help with that. I have not used it so I can't offer my experiences.

New Post: Specified cast is not valid. (at

$
0
0
It would be useful to see your Deploy-Application.ps1 script to better understand why you are getting this error.

New Post: Command line arguments for Deploy-Application.EXE

$
0
0
I'm wondering if there is any syntax to apply command line arguments to Deploy-Application.EXE? I would like to pass variables into powershell to run the install in different ways.

A couple examples of stuff we do in Wise today.
  • /Admin argument to install the admin version of an install as opposed to the client
  • /Repair argument to run an installshield with a repair .iss instead of an install.
  • /Patch to just run a patch portion of the install.
These arguments allow me to utilize one package with different programs in SCCM to install multiple ways. It would be nice to use an argument to set a variable along with the DeploymentType to run certain actions.

Also, a second question to repair. I notice there is a lot of MSI automation. Is there anything to tell an MSI that is already installed to just run a repair?

New Post: If statement to check for an installed application then uninstall if found.

$
0
0
Thanks for the help Paul.

I will test it and report back.

I did try the Remove-MSIApplications, but for whatever reason it will not uninstall this application.

I then decided to build an uninstaller using PsApp with the following code:

Execute-MSI -Action Uninstall -Path "{49E48BAD-ED29-44FF-BB27-9BE66CC61852}"

and it works. I want to think it is because the old version of this app is installed in the "users app data folder", but the new version installs in ProgramData, but this should not matter as I do reference the GUID.

Maybe I am better off running the Execute-MSI -Action Uninstall -Path "{49E48BAD-ED29-44FF-BB27-9BE66CC61852}" then add a pause, then remove the second application.

You have given me something to think about regardless.

Thanks

Reviewed: PowerShell App Deployment Toolkit v3.2.0 (Oct 01, 2014)

$
0
0
Rated 5 Stars (out of 5) - Every time I run into an issue I find it has already been addressed in the next release ;-) I love this toolkit! Current Issue: "Failed to grab execution mutex. System error 258." Latest Version Release Notes for 3.2.0: "Added a check for in-progress MSI installations preventing an MSI from installing and waits up to 10 minutes - this reduces instances of MSI error code 1618 (Test-MsiExecMutex)"

New Post: I just want to say THANK YOU!

$
0
0
Since I have moved to using this toolkit for all my installs I have found adjusting the installations are much quicker and smoother. A lot of times I needed to close apps or uninstall old version and traditionally used a one-off script to accomplish the task at hand which was always less than perfect. Now I have a template ps1 file to incorporate all the things I have had to do thus far so I never have to reinvent the wheel for things I have already done. The fact that all the ps1 files have the same look and feel is also nice. The logging provided has also allowed me to quickly troubleshoot issues that would have taken much longer in the past. Now all my deployments have logging be default. I can't say enough good things about toolkit.

Thanks Again!

New Post: Test-VPNConnection Function: Need help testing to see if it works reliably in other environments

$
0
0
<#
.SYNOPSIS
    Check to see if there is an active VPN connection.
    
.DESCRIPTION
    Check to see if there is an active VPN connection by using the Win32_NetworkAdapter and the 
    Win32_NetworkAdapterConfiguration WMI classes.
    
.PARAMETER NotMatchAdapterDescription
    Excludes on the network adapter description field using regex matching. Precedence order: 0.
    Following WAN Miniport adapters are used for Microsoft Remote Access based VPN
     so are not excluded by default: L2TP, SSTP, IKEv2, PPTP
    
.PARAMETER LikeAdapterDescription
    Matches on the network adapter description field using wild card matching. Precedence order: 1.
    
.PARAMETER LikeAdapterDNSDomain
    Matches on the network adapter DNS Domain field using wild card matching. Precedence order: 2.
    
.PARAMETER LikeAdapterDHCPServer
    Matches on the network adapter DHCP Server field using wild card matching. Precedence order: 3.
    
.PARAMETER LikeAdapterDefaultGateway
    Matches on the network adapter Default Gateway field using wild card matching. Precedence order: 4.
    
.PARAMETER DisplayNetworkAdapterTable
    Logs the full list of network adapters and also the filterd list of possible VPN connection
     network adapters.
    
.EXAMPLE
    Test-VPNConnection
    
.NOTES
    $AllNetworkAdapterConfigTable contains all criteria for detecting VPN connections.
    Try to choose criteria that:
      1) Uniquely identifies the network(s) of interest.
      2) Try not to rely on networking data that may change in future. For example, default gateways
         and DNS and DHCP addresses may change over time or there may be too many to match on.
         Try to use wildcard or regular expression matches if there is an available pattern
         to match multiple values on.
.LINK
    
#>

Created Unassigned: Failed to grab execution mutex [87]

$
0
0
"Failed to grab execution mutex. System error 258." Latest Version Release Notes for 3.2.0: "Added a check for in-progress MSI installations preventing an MSI from installing and waits up to 10 minutes - this reduces instances of MSI error code 1618 (Test-MsiExecMutex)"
by mniccum

New Post: Change the deploy mode to interactive only if file is in use

$
0
0
Hi
I am wanting to deploy a Java update to machines. The issue I have is that if IE is open, the installation will not complete properly. Long story short, installing at log on and log off via SCCM are not working out so I would like to use the powershell app deployment toolkit to install the update.

What I would like to do is run the installation silently unless IE is open. I don't want to display a welcome screen, I just want to check if IE is open first and if it is then prompt the user and allow them to defer the installation. If it isn't, then I want to run the installation silently so the user doesn't know it's happening.

Can anyone suggst the best way of achieving this ?

Thanks

G

New Post: Change the deploy mode to interactive only if file is in use

$
0
0
It looks like -AllowDeferColseApps does what I need.

G

New Post: I just want to say THANK YOU!

Viewing all 2341 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>