Hi!.
I’m having the following error:
El recurso de DSC de PowerShell MSFT_ScriptResource no pudo ejecutar la funcionalidad de Set-TargetResource con el mensaje de error: El ensamblado de modo mixto se ha compilado con la
versión ‘v2.0.50727’ del runtime y no se puede cargar en el runtime 4.0 sin información de configuración adicional.
+ CategoryInfo : InvalidOperation: ( , CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : serverXX
El servicio WS-Management no puede procesar la solicitud. El servicio WMI o el proveedor de WMI devolvió un error desconocido: HRESULT 0x800706be
+ CategoryInfo : NotSpecified: (root/Microsoft/…gurationManager:String) , CimException
+ FullyQualifiedErrorId : HRESULT 0x800706be
The Script execute : invoke-sqlcmd its very simple:
Configuration ScriptTest
{
param (
[string] $ComputerName
)
Import-DscResource –ModuleName ‘PSDesiredStateConfiguration’
node $ComputerName {
Script SQLEmito {
GetScript = {
@{
GetScript = $GetScript
SetScript = $SetScript
TestScript = $TestScript
Result = $True
}
}
SetScript = {
write-verbose "running ConfigurationFile.TestScript";
try {
Import-Module -Name SQLPS -DisableNameChecking -Verbose:$False -ErrorAction Stop # SQLPS has unapproved verbs, disable checking to ignore Warnings.
}
catch
{
throw $_.Exception
}
#$sql = "ALTER LOGIN [pepito] WITH DEFAULT_DATABASE=[PRUEBASDB], DEFAULT_LANGUAGE=[us_english];"
$sql = "SELECT GETDATE();"
Invoke-Sqlcmd -Query $sql -ServerInstance "SERVER26\SQL2014SE" -Database Master
}
TestScript = { return $False }
}
}
}
Any Ideas?
If I try the Invoke-sqlcmd on the server works.
Thanks in advance.
Emito.