Executing and troubleshooting PowerShell scripts
You install and upgrade SDL Web databases and software components by executing scripts using Windows PowerShell. If you are unfamiliar with PowerShell, you may need to perform some actions before you can execute the scripts.
Procedure
- On a supported Windows machine, click the Start button in the lower-left corner of your screen and type
PowerShellin the search box to quickly access and open the Windows PowerShell program. - In PowerShell, navigate to the folder on the installation media that contains the PowerShell script you want to execute.
- Enter
lsto view the available scripts. - If you are installing a database, then note that by default, PowerShell applies timeouts of 10 minutes to your database operations. If you expect this to be insufficient because your database is too large, change the timeout values by setting them as follows:
$DatabaseScriptConnectTimeout=VALUE $DatabaseScriptCommandTimeout=VALUEwhere VALUE is the timeout value in seconds (for example, 3600 sets a 1-hour timeout value).
- Run the script. For example, enter the following command to run a database script:
& '.\Install DATABASENAME database.ps1'where DATABASENAME is the name of the database you are installing.
- Optional: If you get the following errors:
-
File
<ScriptName>.ps1cannot be loaded because the execution of scripts is disabled on this system -
Enable the running of PowerShell scripts by entering the following PowerShell command:
Set-ExecutionPolicy AllSignedNote: If the command fails due to registry write errors, select Windows PowerShell Run as administrator. - Could not load file or assembly <Path>\Database\Scripts\Tridion.Database.Management.dll or one of its dependencies (only for database scripts)
-
In Windows Explorer, navigate to the installation media \Database\Scripts\ folder, select
Tridion.Database.Management.dlland click Properties. In the General tab, click Unblock. Click OK to close the dialog. Then restart PowerShell and perform the same steps as before.
-
File
- Follow the instructions in the PowerShell console to install the database or software component.