Scripts/Experimental.ps1
#$d = (Get-Date).AddDays(-7) Write-Output "List of recently created certificates, not older than 10 days:" Get-ChildItem Cert:\ -Recurse | Where-Object {$_.NotBefore -gt ((Get-Date).AddDays(-10))} | Select-Object -Property Subject, NotBefore, PsPath | Format-List # Write-Output "List of certificates that expire soon, in the next 7 days:" # Get-ChildItem Cert:\ -Recurse | # Where-Object {$_.NotAfter -gt ((Get-Date).AddDays(-1)) -And $_.NotAfter -lt ((Get-Date).AddDays(7))} | # Select-Object -Property Subject, NotAfter, PsPath | Format-List # function OpenVsDevAndGetPendingChanges() # { # <# # .SYNOPSIS # Gets a hashset of all pending changes. # #> # if((IsVsDev) -eq $false) # { # CallVsDev "$VsVersion" *>$null # } # $result = Invoke-Expression "tf vc status /collection:$TfsUrl" # $lines = $result -split "`r`n" # $files = New-Object System.Collections.Generic.HashSet[string] # foreach($line in $lines) # { # if(-not ($line.StartsWith('$'))) # { # $parts = $($line -split '\s+') # if($parts.Length -gt 2) # { # $file = $parts[2] # if(Test-Path -Path "$file") # { # $null = $files.Add($parts[2]) # } # } # } # } # return $files # } # function ExecuteProcess ($fileName, $arguments) # { # <# # .SYNOPSIS # Executes the given process and waits infinitely until the process has # finished. # #> # $info = New-Object System.Diagnostics.ProcessStartInfo # $info.FileName = "$fileName" # $info.Arguments = "$arguments" # $info.RedirectStandardError = $true # $info.RedirectStandardOutput = $true # $info.UseShellExecute = $false # $p = New-Object System.Diagnostics.Process # $p.StartInfo = $info # $p.Start() | Out-Null # $p.WaitForExit() # $standardOut = $p.StandardOutput.ReadToEnd() # $standardError = $p.StandardError.ReadToEnd() # $exitCode = $p.ExitCode # [pscustomobject]@{ # StandardOut = $standardOut # StandardError = $standardError # ExitCode = $exitCode # } # } |