I’m really excited with us finally getting Microsoft OneDrive into the Evergreen PowerShell module. I see increased usage of OneDrive in Enterprises. Windows 10 and Windows 2019 both have an amazing feature called OneDrive Files on Demand which is a must in Non Persistent EUC environments. And to top that, the latest Microsoft FSLogix Apps 2004 make Windows Search work, that’s why I’m so excited.
I’m using the latest version in the Insider Ring, but you can also change to use e.g. Enterprise.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# PowerShell Wrapper for MDT, Standalone and Chocolatey Installation - (C)2015 xenappblog.com # Example 1: Start-Process "XenDesktopServerSetup.exe" -ArgumentList $unattendedArgs -Wait -Passthru # Example 2 Powershell: Start-Process powershell.exe -ExecutionPolicy bypass -file $Destination # Example 3 EXE (Always use ' '): # $UnattendedArgs='/qn' # (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode # Example 4 MSI (Always use " "): # $UnattendedArgs = "/i $PackageName.$InstallerType ALLUSERS=1 /qn /liewa $LogApp" # (Start-Process msiexec.exe -ArgumentList $UnattendedArgs -Wait -Passthru).ExitCode Clear-Host Write-Verbose "Setting Arguments" -Verbose $StartDTM = (Get-Date) Write-Verbose "Installing Modules" -Verbose if (!(Test-Path -Path "C:\Program Files\PackageManagement\ProviderAssemblies\nuget")) {Find-PackageProvider -Name 'Nuget' -ForceBootstrap -IncludeDependencies} if (!(Get-Module -ListAvailable -Name Evergreen)) {Install-Module Evergreen -Force | Import-Module Evergreen} Update-Module Evergreen $Vendor = "Microsoft" $Product = "OneDrive for Business" $PackageName = "OneDriveSetup" $Evergreen = Get-MicrosoftOneDrive | Where-Object {$_.Ring -eq "Insider"} $Version = $Evergreen.Version $URL = $Evergreen.uri $InstallerType = "exe" $Source = "$PackageName" + "." + "$InstallerType" $LogPS = "C:\Windows\Temp\$Vendor $Product $Version PS Wrapper.log" $LogApp = "C:\Windows\Temp\$Product.log" $ProgressPreference = 'SilentlyContinue' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $UnattendedArgs = '/allusers /silent' Start-Transcript $LogPS If (!(Test-Path -Path $Version)) {New-Item -ItemType directory -Path $Version | Out-Null} CD $Version Write-Verbose "Downloading $Vendor $Product $Version" -Verbose If (!(Test-Path -Path $Source)) {Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $Source} Write-Verbose "Starting Installation of $Vendor $Product $Version" -Verbose (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode Write-Verbose "Customization" -Verbose Write-Verbose "Stop logging" -Verbose $EndDTM = (Get-Date) Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose Stop-Transcript |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# PowerShell Wrapper for MDT, Standalone and Chocolatey Installation - (C)2015 xenappblog.com # Example 1: Start-Process "XenDesktopServerSetup.exe" -ArgumentList $unattendedArgs -Wait -Passthru # Example 2 Powershell: Start-Process powershell.exe -ExecutionPolicy bypass -file $Destination # Example 3 EXE (Always use ' '): # $UnattendedArgs='/qn' # (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode # Example 4 MSI (Always use " "): # $UnattendedArgs = "/i $PackageName.$InstallerType ALLUSERS=1 /qn /liewa $LogApp" # (Start-Process msiexec.exe -ArgumentList $UnattendedArgs -Wait -Passthru).ExitCode # Example 5 MSI with Space in the file name we need to use double quotes # $UnattendedArgs = "/i `"$PackageName.$InstallerType`" ALLUSERS=1 /qn /liewa `"$LogApp`"" Clear-Host Write-Verbose "Setting Arguments" -Verbose $StartDTM = (Get-Date) Write-Verbose "Installing Modules" -Verbose if (!(Test-Path -Path "C:\Program Files\PackageManagement\ProviderAssemblies\nuget")) {Find-PackageProvider -Name 'Nuget' -ForceBootstrap -IncludeDependencies} if (!(Get-Module -ListAvailable -Name Evergreen)) {Install-Module Evergreen -Force | Import-Module Evergreen} Update-Module Evergreen $Vendor = "Microsoft" $Product = "FSLogix Apps" $PackageName = "FSLogixAppsSetup" $Evergreen = Get-MicrosoftFSLogixApps $Version = $Evergreen.Version $URL = $Evergreen.uri $DownloadType = "zip" $InstallerType = "exe" $Source1 = "$PackageName" + "." + "$DownloadType" $Source2 = "$PackageName" + "." + "$InstallerType" $LogPS = "${env:SystemRoot}" + "\Temp\$Vendor $Product $Version PS Wrapper.log" $LogApp = "${env:SystemRoot}" + "\Temp\$PackageName.log" $Destination = "${env:ChocoRepository}" + "\$Vendor\$Product\$Version\$packageName.$installerType" $ProgressPreference = 'SilentlyContinue' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $UnattendedArgs = '/S' Start-Transcript $LogPS | Out-Null If (!(Test-Path -Path $Version)) {New-Item -ItemType directory -Path $Version | Out-Null} CD $Version Write-Verbose "Downloading $Vendor $Product $Version" -Verbose If (!(Test-Path -Path $Source1)) { Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $Source1 Expand-Archive -Path "$PackageName.$DownloadType" -DestinationPath . } CD x64\Release Write-Verbose "Starting Installation of $Vendor $Product $Version" -Verbose (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode Write-Verbose "Customization" -Verbose Write-Verbose "Stop logging" -Verbose $EndDTM = (Get-Date) Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose Stop-Transcript |
I was trying to use this script and get the following error when i run it…any idea what that could be out of interest? Cheers 🙂
Transcript started, output file is C:\Windows\Temp\Microsoft OneDrive for Business 20.169.0823.0008 20.169.0823.0008 PS Wrapper.log
Set-Location : Cannot convert ‘System.Object[]’ to the type ‘System.String’ required by parameter ‘Path’. Specified method is not supported.
At C:\Windows\Temp\eg-OneDrive.ps1:38 char:4
+ CD $Version
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.SetLocationCommand
Hi Andrew, these scripts changes over time, specially for OneDrive, Teams, Adobe, Google and Firefox. Please check latest version : https://github.com/haavarstein/Applications/tree/master/Microsoft/OneDrive%20for%20Business