Instalacja Office Click-to-Run

📦 Office 365 POWERSHELL ChrisTitusTech

Instaluje pakiet Microsoft Office w wersji Click-to-Run przy użyciu Office Deployment Tool (ODT) i pliku konfiguracyjnego XML. Obsługuje instalację cichą bez interakcji użytkownika.

Pobierz .ps1
📄 Install-OfficeClickToRun.ps1 🕒 2026-04-13 📦 Źródło: christitustech
Install-OfficeClickToRun.ps1
try {
Add-Type  -ErrorAction SilentlyContinue -TypeDefinition @"
   public enum OfficeCTRVersion
   {
      Office2013,
      Office2016
   }
"@
} catch {}

try {
$enum = "
using System;
 
namespace Microsoft.Office
{
     [FlagsAttribute]
     public enum Products
     {
         Unknown = 0,
         O365ProPlusRetail = 1,
         O365BusinessRetail = 2,
         VisioProRetail = 4,
         ProjectProRetail = 8,
         SPDRetail = 16,
         VisioProXVolume = 32,
         VisioStdXVolume = 64,
         ProjectProXVolume = 128,
         ProjectStdXVolume = 256,
         InfoPathRetail = 512,
         SkypeforBusinessEntryRetail = 1024,
         LyncEntryRetail = 2048,
         AccessRuntimeRetail = 4096
     }
}
"
Add-Type -TypeDefinition $enum -ErrorAction SilentlyContinue
} catch {}

try {
$enum2 = "
using System;
 
    [FlagsAttribute]
    public enum LogLevel
    {
        None=0,
        Full=1
    }
"
Add-Type -TypeDefinition $enum2 -ErrorAction SilentlyContinue
} catch {}

try {
Add-Type  -ErrorAction SilentlyContinue -TypeDefinition @"
   public enum PinAction
   {
      PinToStartMenu,
      PinToTaskbar,
      UnpinFromStartMenu,
      UnpinFromTaskbar
   }
"@
} catch {}

function Install-OfficeClickToRun {
<#
.SYNOPSIS
    Installs Office Click-To-Run

.DESCRIPTION
    Installs Office Click-To-Run using a specified configuration file or targetfilepath.

.PARAMETER ConfigurationXML
    The path to a pre-configured configuration.xml file used for installation.

.PARAMETER TargetFilePath
    If no ConfigurationXML is specified, this is the path where the generated configuration.xml will be saved.

.PARAMETER PinToStart 
    If $true, all Office apps will be pinned to the Start Menu in Windows 10.

.PARAMETER OfficeVersion
    The version of Office Click-To-Run to install. Available options are Office2013 and Office2016. 

.PARAMETER WaitForInstallToFinish
    If $true, the PowerShell console will remain open and provide status updates until Office is finished installing.

.PARAMETER PinToStartMenu
    Choose one or multiple Office applications to pin to the Start Menu after the installation is finished. 

.PARAMETER PinToTaskbar
    Choose one or multiple Office applications to pin to the Taskbar after the installation is finished. Pinning applications
    to the Taskbar in Windows 10 is not natively supported.

.EXAMPLE
    Install-OfficeClickToRun -ConfigurationXML C:\OfficeDeployment