This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-Csr | |
| { | |
| [CmdletBinding()] | |
| param | |
| ( | |
| [Parameter(ValueFromPipeline, Mandatory)] | |
| [string] $Path = '.', | |
| [ValidateSet('CertUtil, OpenSSL')] | |
| [string] $Format = 'CertUtil' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-Csr | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory, ValueFromPipeline)] | |
| [string] $CN, | |
| [Parameter(Mandatory, ValueFromPipeline)] | |
| [string[]] $SAN, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-Csr { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
| [string]$DomainName | |
| ) | |
| begin { | |
| # --- 0. Check for Administrator privileges --- | |
| if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://superuser.com/a/1199773 | |
| $path = gps OUTLOOK | % path | split-path | |
| if (!$path) { | |
| Write-Host -f Red "Outlook is not running. Please start Outlook and try again." | |
| } | |
| "[Description] | |
| MessageClass=IPM.Note | |
| CLSID={00020D31-0000-0000-C000-000000000046} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @( | |
| 'CVE-2025-24065' | |
| 'CVE-2025-24068' | |
| 'CVE-2025-24069' | |
| 'CVE-2025-29828' | |
| 'CVE-2025-3052' | |
| 'CVE-2025-32710' | |
| 'CVE-2025-32712' | |
| 'CVE-2025-32713' | |
| 'CVE-2025-32714' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $h = 'C:\windows\system32\drivers\etc\hosts' | |
| @( | |
| "127.0.0.1 `t dev.localdev.info" | |
| ) | % { | |
| (cat $h) + $_ | Out-File $h -Encoding ascii | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # yyyyMMdd_HHmmsszzz | % Replace ':' | |
| dir -File | % { | |
| $d = $_.BaseName.Substring(0,8) | |
| md $d -ea 0 | |
| move $_.FullName $d | |
| } | |
| $dir = dir -Directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Given a list of paths, remove all paths whose parent is already in the list. | |
| #> | |
| function Get-PathCollapsed | |
| { | |
| param ( | |
| [string[]] $Paths | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dir | % { | |
| $exif = exiftool -G2 -json $_.FullName | ConvertFrom-Json | |
| $exif.'Camera:Model' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $site = Get-SPSite http://site.local/ | |
| $query = New-Object -TypeName Microsoft.SharePoint.SPAuditQuery($site) | |
| $query.RowLimit = 10 | |
| $query.SetRangeStart((Get-Date).Date) | |
| $query.AddEventRestriction([Microsoft.SharePoint.SPAuditEventType]::ChildMove) | |
| $site.Audit.GetEntries($query) | Out-GridView |
NewerOlder