Lukesalter.files.wordpress.com



#################################################

## Created By: Luke Salter ##

## Created On: 19/05/2014 ##

## Modified On: 19/05/2014 ##

## Create AppV & Deploy TO UAT - CSV Input ##

#################################################

## Load Configuration Manager Module and Switch to EH Site Server

CD "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin"

import-module .\ConfigurationManager.psd1

CD EH1:

function CreateAppVApplication {

$pkgsource="P:\PkgSource\Applications\"+$AppName

$Directory = Get-ChildItem $pkgsource -filter *.Appv -Recurse -Force | Select-Object Directory

$Directory = $Directory -replace "@{Directory=P:", "\\sdcscm01"

$Directory = $Directory -replace "PkgSource", "PkgSource$"

$Directory = $Directory -replace "}", ""

New-CMApplication -name $AppName

Set-CMApplication -Name $AppName -localizedApplicationName $AppName -AppCategories 'App-V'

Add-CMDeploymentType -ApplicationName $AppName -InstallationFileLocation $Directory\$AppName'.appv.' -AppV5xInstaller -AutoIdentifyFromInstallationFile -ForceForUnknownPublisher $true -DeploymentTypeName $AppName' - AppV Installer' -OnSlowNetworkMode DownloadContentForStreaming -AllowClientsToUseFallbackSourceLocationForContent $true

}

function CreateAppVDeployment {

## Distribute Content

Start-CMContentDistribution -ApplicationName $AppName -DistributionPointGroupName "All Distribution Points"

## Create Application Deployment

Start-CMApplicationDeployment -Name $AppName -CollectionName TEST_UAT -Comment "Created Automatically" -DeployPurpose Available -DeployAction Install

}

## Read Applications CSV File

import-csv 'C:\Temp\Powershell\Collection Creation\AppVApps.csv' | foreach {

$AppName=$_.APP

CreateAppVApplication

CreateAppVDeployment

}

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download