From fee0302a7ed9ee0773029d50b3788d1b5cb6116b Mon Sep 17 00:00:00 2001 From: Rainson12 Date: Tue, 6 Dec 2016 15:30:11 +0100 Subject: [PATCH] Script doesnt work on German Culture The script doesnt work with a server running on a diffrent time format as the "/" will be replaced with "." by powershell. Executing (Get-Date).ToString("MM/dd/yyyy") will return "06.12.2016" the slashes have to be in single quotation marks. --- .../Lab/Scripts/CreateTestCertificateForS2STrust.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Student/Modules/06_AddinSecurity/Lab/Scripts/CreateTestCertificateForS2STrust.ps1 b/Student/Modules/06_AddinSecurity/Lab/Scripts/CreateTestCertificateForS2STrust.ps1 index 81f39f1..d9d8ba3 100644 --- a/Student/Modules/06_AddinSecurity/Lab/Scripts/CreateTestCertificateForS2STrust.ps1 +++ b/Student/Modules/06_AddinSecurity/Lab/Scripts/CreateTestCertificateForS2STrust.ps1 @@ -5,8 +5,8 @@ $makecert = $PSScriptRoot + "\makecert.exe" $certname = "WingtipAppCertificate01" $password = ConvertTo-SecureString "Password1" -AsPlainText -Force -$startdate = (Get-Date).ToString("MM/dd/yyyy") -$enddate = ((Get-Date).AddYears(2)).ToString("MM/dd/yyyy") +$startdate = (Get-Date).ToString("MM'/'dd'/'yyyy") +$enddate = ((Get-Date).AddYears(2)).ToString("MM'/'dd'/'yyyy") # delete any pre-existing certifcates with same name Get-ChildItem Cert:\CurrentUser\My | ? {$_.Subject -eq "CN=$certname"} | Remove-Item