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
| # Inspiration from https://gist.github.com/d4rkeagle65/b9bc42a26be44a6d66c4858a4c3bc944 by d4rkeagle65 | |
| # Output to object by Diagg/OSD-Couture.com | |
| $Dsregcmd = New-Object PSObject ; Dsregcmd /status | Where {$_ -match ' : '}|ForEach {$Item = $_.Trim() -split '\s:\s'; $Dsregcmd|Add-Member -MemberType NoteProperty -Name $($Item[0] -replace '[:\s]','') -Value $Item[1] -EA SilentlyContinue} | |
| # to vue full objest type : $Dsregcmd | |
| # to vue property TenantID : $Dsregcmd.TenantId |
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
| # OSFriendlyBuild.ps1 by Diagg/OSD-Couture.com | |
| $OSBuild = @{} | |
| $BuildNumber = (Get-ItemProperty 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion').CurrentBuild | |
| IF ([int]($BuildNumber) -lt 22000){$HTML = Invoke-RestMethod 'https://docs.microsoft.com/en-us/windows/release-health/release-information'} | |
| else {$HTML = Invoke-RestMethod 'https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information'} | |
| $Pattern = '<strong>(?<version>.*)<\/strong>' | |
| $AllMatches = ($HTML | Select-String $Pattern -AllMatches).Matches | |
| ($AllMatches.Groups | Where-Object {$_.name -eq 'version'}).value -replace "Version " -replace "\(RTM\) " -replace "\(original release\) " -replace "\(OS build" -replace "\)"| ForEach-Object {$Htbl = $_ -split " "; $OSBuild[$Htbl[2]] = $Htbl[0]} | |
| Try {[System.Environment]::SetEnvironmentVariable('OSBUILD',$OSBuild[$buildnumber],'Machine')} |
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
| ## Parse BCDedit enumation to a Powershell Object | |
| ## By Diagg/OSDC - 26/10/2021 | |
| ## Usage exemple: $Bcdedit|where Index -eq 0|select default | |
| $ObjName = $null ; $Val = 0 ; $Index = 0 ; $Bcdedit = @() | |
| $BcdString = bcdedit /v | |
| $BcdString|Foreach { | |
| If ($_.startswith('-')) | |
| { |
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 Invoke-ScheduledTask | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory = $true)] | |
| [String]$TaskName, | |
| [Parameter(Mandatory = $true)] | |
| [String]$command, | |
| [Parameter(Mandatory = $false)] | |
| [string]$Parameters, |
OlderNewer