10

I'm running the SDL Tridion 2013 Sp1 database upgrade scripts but running into the following error :

Import-Module : Could not load file or assembly 'file:///C:\Tridion 2013
SP1\database\Scripts\Tridion.Database.Management.dll' or one of its dependencies. Operation is not supported.
(Exception from HRESULT: 0x80131515)
At C:\U\Tridion 2013 SP1\database\Scripts\Utilities.ps1:16 char:1
+ Import-Module (Join-Path -Path $PSScriptDir -ChildPath "..\Scripts\Tridion.Datab 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand.

To run I'm navigating directly to the script directory and running:

& '.\Upgrade Content Manager database.ps1'

or

& '.\Upgrade Content Data Store.ps1'

My set up is 2013 GA, running on SQL Server 2008 R2.

9

You have to unblock the Tridion.Database.Management.dll as described in the documentation (bullet 6, login required)

4

Couple of things, I suspect for generating 'Import-Module : Could not load file or assembly' error

  1. Make sure you enable .Net 4.0 for powershell

Create a file “powershell.exe.config” in C:\Windows\System32\WindowsPowerShell\v1.0

<?xml version="1.0"?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0.30319"/>
        <supportedRuntime version="v2.0.50727"/>
        <supportedRuntime version="v4.6" />    
    </startup>
</configuration>

2. DLL might be blocked, it needs to un-block

2

If you have "IE Enhanced Security Configuration" (ON by default in Windows 2012 R2) then this also causes the problem you have if your install files are on a Network Drive.

You can just switch it off in Server Manager or Add the Network Drive Server into your Trusted sites

Add file://networkdriveservername into the Local Internet Sites in IE Internet Explorer |Options | Security |Local Intranet | Sites

You can also do this with PowerShell

Function AddManagementServerToTrustedSites 
{
Param ([string]$TrusterServer)

$TrustedSitesPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains'
$TrustedKeyPath = "$TrustedSitesPath\$TrusterServer"
$LocalIntranetZone = 1
$TrustedSitesZone = 2

If (!(Test-Path -Path $TrustedKeyPath))
{New-Item -Path $TrustedSitesPath  -Name $TrusterServer} #Add site if not present

$Item = Get-Item -Path $TrustedKeyPath
If ($Item.GetValue('file',$null) -eq $null)
{New-ItemProperty -Path $TrustedKeyPath -Name file -PropertyType DWord -Value $LocalIntranetZone} # Add file key if not present

$key = Get-ItemProperty $TrustedKeyPath -Name file 
if ($key.file -ne 1 )
{Set-ItemProperty $TrustedKeyPath -Name file -Value $LocalIntranetZone} # set file key to 1 if not 1

Write-Log "$TrusterServer is trusted in Local Intranet Zone"
}
0

For some reason a different PowerShell version might be started. Make sure you are using at least version 3:

powershell.exe -v 3

And see the accepted answer to unblock the dll.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.