Adapted from Class diagrams
Type: classdiagram
e.g. -idCard : IdCard
| Param([Parameter(Mandatory)][string]$Path) | |
| # Caveats: | |
| # | |
| # Get-AuthenticodeSignature cmdlet has the following limitations: | |
| # * Only first signature is fetched; | |
| # * If the signature is timestamped, no signing time is provided; | |
| # * No signature algorithm information is provided. | |
| $chain = New-Object -TypeName Security.Cryptography.X509Certificates.X509Chain |
| # Note: This doesn't always work correctly. | |
| # might get: Uninstall-Package: No match was found for the specified search criteria and module names... | |
| # Can remove all az.* packages (and then manually reinstall) using: | |
| # $env:PSModulePath -split ';' | ForEach-Object { Get-ChildItem -Directory -Path (Join-Path $_ 'Az.*') | ForEach-Object { Remove-Item -LiteralPath $_.FullName -Recurse -Verbose -Force } } | |
| # (Which could also be updated to remove just older versions in each folder) | |
| foreach ($module in (Get-Module -ListAvailable -Name 'Az*').Name | Get-Unique) { | |
| $modules = Get-Module -ListAvailable $module | |
| if ($modules.Count -gt 1) { |
| <# | |
| .SYNOPSIS | |
| Combination of "git grep" and "git blame". | |
| #> | |
| function gitgrepblame { | |
| Param([Parameter(Mandatory)][string]$Query) | |
| # grep "--null" uses null separators, blame "-c" uses tab separators. | |
| git.exe --no-pager grep --null --line-number $Query ` | |
| | Select-String -Pattern '(?<Filename>[^\0]+)\0(?<Line>[1-9][0-9]*)\0\s*(?<Text>.+)' ` |
| using System.Diagnostics; | |
| using System.Text; | |
| using (Process process = new Process()) | |
| { | |
| int timeoutMS = 1000; | |
| process.StartInfo.FileName = "powershell.exe"; | |
| process.StartInfo.Arguments = "-NoLogo -NoProfile -NonInteractive -Command \"&{ Get-DeliveryOptimizationLog }\""; | |
| process.StartInfo.UseShellExecute = false; | |
| process.StartInfo.CreateNoWindow = true; |
Adapted from Class diagrams
Type: classdiagram
e.g. -idCard : IdCard