NuGet in Powershell aktualisieren
Weil ich immer wieder danach suche, habe ich es hier aufgeschrieben.
Original Artikel: https://www.alitajran.com/unable-to-install-nuget-provider-for-powershell/
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord [Net.ServicePointManager]::SecurityProtocol Install-Module PowershellGet -Force
Frost
Sunset
Elsterglanz
E-Mail bei Powershell Script Abbruch
Wer Powershell Scripte über den Windows Taskplaner zur Sicherung einsetzt, möchte vielleicht auch informiert werden, wenn das Script mit einem nicht behandelten Fehler abbricht.
function Send-Mail ($message) { $emailSmtpServer = "smtp.domain.tld" $emailFrom = "taskplaner@domain.tld" $emailTo = "admin@domain.tld" $emailSubject = "Backup Script fail" Send-MailMessage -To $emailTo -From $emailFrom -Subject $emailSubject -Body $message -SmtpServer $emailSmtpServer } $ErrorActionPreference = 'stop' trap { $ErrorActionPreference = 'Continue' Send-Mail -message $_.Exception.Message break } # ... ab hier das eigentliche Script ...
- 1
- 2
- 3
- …
- 10
- Nächste Seite »