Jednym z wymogów instalacyjnych wielu wersji SQL Server jest instalacja .NET Fraework 3.5. Z zasady instalacja nie uda się jeśli Framework nie jest zainstalowany, ale… coś dziwnego się stało. Na serwerze na którym SQL już działał od dłuższego czasu, ni z tego ni z owego pojawił się błąd podczas wykonywania job z SQL Agent:
A job step received an error at line 1 in a PowerShell script. The corresponding line is ‚import-module SQLPS -DisableNameChecking’. Correct the script and reschedule the job. The error information returned by PowerShell is: ‚The module ‚SQLPS.psd1’ requires the following version of the .NET Framework: 3.5. The required version is not installed.
Sposób naprawy jest prosty! Trzeba po prostu doinstalować ponownie .Net Framework i na dodatek nie jest wymagany żaden restart. Oto wszystkie czynności do wykonania z PowerShell:
Jeśli masz do czynienia z serwerem 2008, zacznij od jawnego zaimportowania modułu server manager
1 |
import-module servermanager |
Sprawdź aktualny stan instalacji .NET Framework
1 2 3 4 |
Get-WindowsFeature net-framework-core Display Name Name ------------ ---- [ ] .NET Framework 3.5.1 NET-Framework-Core |
Zainstaluj .NET Framework
1 2 3 4 |
Get-WindowsFeature net-framework-core | Add-WindowsFeature Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {.NET Framework 3.5.1} |
I ewentualnie sprawdź status po instalacji
1 2 3 4 |
Get-WindowsFeature net-framework-core Display Name Name ------------ ---- [X] .NET Framework 3.5.1 NET-Framework-Core |