> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/it/getting-started.md).

# Installazione

## Installazione MSI (Windows)

L'installazione MSI crea un servizio PowerShell Universal. Per impostazione predefinita, PowerShell Universal è in ascolto sulla porta 5000. È possibile navigare a `http://localhost:5000`

I download MSI sono disponibili sulla nostra [pagina di download](https://devolutions.net/download-center/powershell-universal/).

Le installazioni di sistema vengono eseguite come servizio Windows. Le installazioni utente vengono eseguite quando l'utente accede alla macchina. L'installazione utente viene eseguita nel contesto dell'utente.

### Parametri MSI

La tabella seguente contiene i parametri che è possibile specificare se si esegue `msiexec` sulla nostra installazione MSI a scopo di automazione:

| Parametro              | Descrizione                                                                                                                                               | Valore predefinito                                        |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| INSTALLFOLDER          | La cartella di installazione per PowerShell Universal                                                                                                     | %ProgramFiles(x86)%\Universal                             |
| TCPPORT                | La porta TCP su cui il server HTTP sarà in ascolto.                                                                                                       | 5000                                                      |
| REPOFOLDER             | La cartella del repository in cui salvare i file di configurazione.                                                                                       | %ProgramData%\UniversalAutomation\Repository              |
| CONNECTIONSTRING       | La stringa di connessione SQL, SQLite o PostgreSQL.                                                                                                       | Data Source=%ProgramData%\UniversalAutomation\database.db |
| DATABASETYPE           | SQL, SQLite o PostgreSQL                                                                                                                                  | SQLite                                                    |
| STARTSERVICE           | Se avviare il servizio dopo l'installazione (0 o 1)                                                                                                       | 1                                                         |
| SERVICEACCOUNT         | L'account di servizio da impostare per il servizio Windows. Utilizzi il formato dominio\nomeutente.                                                       | Nessuno                                                   |
| SERVICEACCOUNTPASSWORD | La password dell'account di servizio da impostare per il servizio Windows. La password sarà mascherata con \*\*\* nel log del programma di installazione. | Nessuno                                                   |
| TELEMETRY              | Raccolta anonima di dati di telemetria                                                                                                                    | 0                                                         |
| ADDPSMODULEPATH        | Aggiunge la directory del modulo PowerShell Universal alla variabile di ambiente PSModulePath.                                                            | 1                                                         |
| STARTSERVICE           | Se avviare il servizio dopo l'installazione.                                                                                                              | 1                                                         |
| INSTALLTYPE            | Se eseguire un'installazione server o utente.                                                                                                             | Server                                                    |

### Esempio

L'esempio seguente mostra come eseguire `msiexec.exe` per installare PowerShell Universal e fornire i parametri al programma di installazione:

{% code overflow="wrap" %}

```powershell
 Start-Process msiexec.exe -ArgumentList "/I C:\Users\adamr\Downloads\PowerShellUniversal.5.5.2.msi /q /norestart /L*V `"C:\users\adamr\desktop\msi.log.txt`" STARTSERVICE=0 SERVICEACCOUNT=contoso\service_account SERVICEACCOUNTPASSWORD=ThisPasswordWillBeReplacedWithAsterisksInTheMSILogs" -Wait -NoNewWindow
```

{% endcode %}

## Installazione ZIP

È anche possibile scaricare lo ZIP dalla nostra [pagina di download](https://devolutions.net/download-center/powershell-universal/) se si desidera distribuire i file tramite xcopy su Windows o Linux.

### Windows

È possibile avviare Universal decomprimendo il contenuto, sbloccando i file ed eseguendo poi `Universal.Server.exe`.

```powershell
Expand-Archive -Path .\Universal.zip -DestinationPath .\Universal
Get-ChildItem .\Universal -Recurse | Unblock-File
Start-Process .\Universal\Universal.Server.exe
```

### Linux

È possibile utilizzare la seguente riga di comando su Linux per installare e avviare PowerShell Universal:

```bash
 wget -O psu.zip https://powershelluniversal.com/download/psu/linux-x64/latest
 sudo apt install unzip 
 unzip psu.zip -d PSU
 chmod +x ./PSU/Universal.Server
 ./PSU/Universal.Server
```

## Servizio Linux

È possibile utilizzare `systemd` per avviare PowerShell Universal come servizio. Lo script seguente è un esempio di download di una versione di PowerShell Universal e della sua installazione come servizio:

```bash
# ----
# This script will install PowerShell Universal on Linux as a service
# This has been tested on Ubuntu 20.04 (ARM64) on a Raspberry Pi 4
# ----
# Dependencies:
# wget
# unzip
#
# Make sure they are installed
# ----

# These are used to derive the download URL
PSU_VERSION="5.5.2" # Change this to the current version
PSU_ARCH="arm64" # Change this to your desired architecture
PSU_FILE="Universal.linux-${PSU_ARCH}.${PSU_VERSION}.zip"
PSU_URL="https://imsreleases.blob.core.windows.net/universal/production/${PSU_VERSION}/${PSU_FILE}"

# These are used for installing PowerShell Universal
# If you'd like to use a different path, change this
PSU_PATH="/opt/psuniversal"
PSU_EXEC="${PSU_PATH}/Universal.Server"

# These are for installing it as a service
PSU_SERVICE="psuniversal"
PSU_USER="psuniversal"

# ----
# BEGIN
# ----

echo "Creating $PSU_PATH and granting access to $USER"
sudo mkdir $PSU_PATH
sudo setfacl -m "u:${USER}:rwx" $PSU_PATH

echo "Creating user $PSU_USER and making it the owner of $PSU_PATH"
sudo useradd $PSU_USER -m
sudo chown $PSU_USER -R $PSU_PATH

echo "Downloading PowerShell Universal $PSU_VERSION ($PSU_ARCH)"
wget -q $PSU_URL -O $PSU_FILE

echo "Extracting $PSU_FILE to $PSU_PATH"
unzip -o -qq $PSU_FILE -d $PSU_PATH

echo "Make $PSU_EXEC executable"
sudo chmod +x $PSU_EXEC

echo "Creating service configuration"
cat <<EOF > ~/$PSU_SERVICE.service
[Unit]
Description=PowerShell Universal
[Service]
ExecStart=$PSU_EXEC
SyslogIdentifier=psuniversal
User=$PSU_USER
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF

echo "Creating and starting service"
sudo cp -f ~/$PSU_SERVICE.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable $PSU_SERVICE
sudo systemctl start $PSU_SERVICE
sudo systemctl status $PSU_SERVICE --no-pager

# If you don't use UFW, you can comment this out
echo "Allow port 5000/tcp"
sudo ufw allow 5000/tcp

# ----
# END
# ----
```

## Modulo PowerShell

È possibile utilizzare il modulo PowerShell di PowerShell Universal per installare il server Universal. Per installare il modulo, utilizzi `Install-Module`.

```powershell
Install-Module Devolutions.PowerShellUniversal
```

Per installare il server Universal, è possibile utilizzare `Install-PSUServer`.

```powershell
Install-PSUServer -LatestVersion
```

L'esecuzione di questo comando su Windows crea e avvia un servizio Windows sulla macchina. L'esecuzione di questo comando su Linux crea e avvia un servizio systemd sulla macchina. L'esecuzione di questo comando su Mac OS scarica ed estrae il server PowerShell Universal.

## Docker

Consulti la [pagina Docker](/powershell-universal/it/getting-started/docker.md#installation).

## Installazione IIS

Visiti la [documentazione sull'hosting IIS](/powershell-universal/it/config/hosting/hosting-iis.md) per informazioni su come configurare PowerShell Universal come sito web IIS.

## Configurazione dell'antivirus

PowerShell Universal sfrutta appieno PowerShell e l'SDK di PowerShell. Include script PowerShell direttamente nel prodotto. Consideri di configurare l'antivirus per consentire l'esecuzione degli script PowerShell in PowerShell Universal.

### Directory

Le directory seguenti contengono esempi, tratti da un sistema Windows standard, di script e file eseguibili che potrebbe essere necessario escludere dai controlli antivirus. La modifica dei percorsi in appsettings.json o nel programma di installazione richiede la modifica delle directory escluse.

| Percorso                          | Descrizione                                                                                                            |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| %ProgramData%\PowerShellUniversal | Contiene i file di log e appsettings.json                                                                              |
| %ProgramData%\UniversalAutomation | Contiene script e artefatti PowerShell. Contiene il database a file singolo quando non si utilizza l'integrazione SQL. |
| %ProgramFiles(x86)\Universal      | Contiene gli eseguibili, le librerie e i moduli dell'applicazione PowerShell Universal.                                |

### Eseguibili

Potrebbe essere necessario escludere alcuni eseguibili che avviano script PowerShell. Di seguito è riportato un elenco di eseguibili che eseguono PowerShell da PowerShell Universal.

| Nome                         | Descrizione                                              |
| ---------------------------- | -------------------------------------------------------- |
| Universal.Server.exe         | Il servizio principale di PowerShell Universal.          |
| PowerShellUniversal.Host.exe | L'eseguibile dell'ambiente host di PowerShell Universal. |
| pwsh.exe                     | PowerShell 7.x                                           |
| PowerShell.exe               | PowerShell 5.x                                           |

## Nome e password predefiniti dell'amministratore

È possibile utilizzare le variabili di ambiente `$ENV:PSUDefaultAdminName` e `$ENV:PSUDefaultAdminPassword` per modificare questo comportamento. Questi valori vengono utilizzati solo se non esiste già un account amministratore. Ciò è utile per le installazioni basate sul cloud.

## Agente

L'agente PowerShell Universal esegue le azioni dell'Event Hub. Lo installi in base al suo ambiente:

### Windows (MSI)

L'MSI dell'agente PowerShell Universal si trova sulla nostra pagina di download. Dopo l'installazione dell'MSI, un servizio agente PowerShell Universal viene eseguito sulla macchina. [Lo configuri](/powershell-universal/it/api/event-hubs.md) per connettersi a PowerShell Universal.

### ZIP

I file ZIP per ogni piattaforma supportata si trovano sulla nostra pagina di download. Ogni ZIP contiene un file `PSUAgent.exe` o `PSUAgent` che può avviare un agente. Esegua il processo come servizio affinché venga avviato ogni volta che la macchina si riavvia.

### Docker

L'immagine del container `devolutions/powershell-universal-agent:latest` fornisce l'agente PowerShell Universal come container Docker Linux.

```
docker pull devolutions/powershell-universal-agent:latest
```

## Passi successivi

A questo punto, Universal è attivo e funzionante. Visiti `http://localhost:5000` o la sua porta predefinita per accedere alla console di amministrazione. Effettui l'accesso con il nome e la password predefiniti dell'amministratore oppure crei un account amministratore predefinito.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/it/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
