Skip to content

Save-EvergreenApp

SYNOPSIS

Downloads target URIs passed to this function from Get-EvergreenApp into a directory structure.

SYNTAX

Path (Default)

Save-EvergreenApp [-InputObject] <PSObject> [[-Path] <FileInfo>] [[-Proxy] <String>]
 [[-ProxyCredential] <PSCredential>] [-Force] [-NoProgress] [-WhatIf] [-Confirm] [<CommonParameters>]

CustomPath

Save-EvergreenApp [-InputObject] <PSObject> [-CustomPath <FileInfo>] [[-Proxy] <String>]
 [[-ProxyCredential] <PSCredential>] [-Force] [-NoProgress] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Saves target URLs passed to this function from Get-EvergreenApp output to into a directory structure below -Path using the properties from the object passed to the function.

Get-EvergreenApp will return an object that may include application properties including (in the following order) - Product, Track, Channel, Release, Ring, Version, Language, and (processor) Architecture. Only properties that exist on the target object will be used.

This simplifies saving the target application installers or updaters into a consistent directory structure without having to build the target directory structure yourself or deal with other functions to download the file.

To override the default behaviour that creates the directory structure based on the properties of the object passed to the function, use the -CustomPath parameter to specify an exact path to save files into. Note that this method download the first file and then will skip files from an object passed from Get-EvergreenApp that includes files with the same name.

EXAMPLES

EXAMPLE 1

Get-EvergreenApp -Name "AdobeAcrobat" | Save-EvergreenApp -Path "C:\Temp\Adobe"

Description: Downloads each file specified in the URIs returned by Get-EvergreenApp -Name "AdobeAcrobat" to a directory structure below C:\Temp\Adobe, resulting in a directory structure per file like: C:\Temp\Adobe\\\\\.

EXAMPLE 2

Get-EvergreenApp -Name "AdobeAcrobat" | Save-EvergreenApp -CustomPath "C:\Temp\Adobe"

Description: Downloads all of the URIs returned by Get-EvergreenApp -Name "AdobeAcrobat" to a directory named C:\Temp\Adobe. All files specified in the URI property will be saved into this directory.

PARAMETERS

-InputObject

Save-EvergreenApp accepts the PSObject from Get-EvergreenApp. Save-EvergreenApp will test for the existence of at least these properties - Version and URI.

Type: PSObject
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Path

The target directory under which a directory structure will be created and application installers saved into. Typically the target path used will be a path per application.

Type: System.IO.FileInfo
Parameter Sets: Path
Aliases:

Required: False
Position: 2
Default value: (Resolve-Path -Path $PWD)
Accept pipeline input: False
Accept wildcard characters: False

-CustomPath

Specify a single directory path where all application installers will be saved into. No sub-directories will be created.

Type: System.IO.FileInfo
Parameter Sets: CustomPath
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Proxy

Specifies a proxy server for the request, rather than connecting directly to the internet resource. Enter the URI of a network proxy server. Note - this is experimental support for proxies.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProxyCredential

Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter. The default is the current user.

Type a user name, such as User01 or Domain01\User01, User@Domain.Com, or enter a PSCredential object, such as one generated by the Get-Credential cmdlet.

This parameter is valid only when the Proxy parameter is also used in the command. Note - this is experimental support for proxy servers and has not been extensively tested.

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: [System.Management.Automation.PSCredential]::Empty
Accept pipeline input: False
Accept wildcard characters: False

-NoProgress

Save-EvergreenApp uses Invoke-WebRequest to download target application installers. Download progress is suppressed by default for faster downloads; however, when -Verbose is used, download progress will be displayed. Use -NoProgress with -Verbose to suppress download progress while also displaying verbose output.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

Forces this function to download the target application installers from the URI property even if they already exist in the target directory.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Management.Automation.PSObject

Save-EvergreenApp accepts the output from Get-EvergreenApp.

OUTPUTS

System.Management.Automation.PSObject

Provides a list of paths of the downloaded target files.

NOTES

Site: https://stealthpuppy.com Author: Aaron Parker Twitter: @stealthpuppy

Download application installers: