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 ConvertFrom-YtTranscript { | |
[CmdletBinding()] | |
Param( | |
#[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)] | |
[Parameter(ValueFromPipeline)] | |
$Transcript, | |
[switch] | |
[bool]$PreserveTime | |
) |
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
$MethodDefinitions = @' | |
using System; | |
using System.Runtime.InteropServices; | |
public class ConsoleCursor { | |
[StructLayout(LayoutKind.Sequential)] | |
internal struct CONSOLE_CURSOR_INFO | |
{ | |
internal uint Size; |
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
# peeked from C:\WINDOWS\Microsoft.Net\assembly\GAC_64\Microsoft.SecureBoot.Commands\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.SecureBoot.Commands.dll | |
$UEFIInterop = Add-Type @" | |
using System; | |
using System.Reflection; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
namespace UEFIInterop | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace UEFIFirmwareVariablenAbfragen | |
{ | |
class Program |
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
# Konvertiert Linux-SCSI Devicenamen nach Windows PhysicalDrive Namen und zurück | |
Function Convert-LinuxDeviceAndWinPhysicalDrive { | |
Param( | |
[string]$deviceOrDisk | |
) | |
If ($deviceOrDisk.ToLower().IndexOf("physicaldisk") -eq 0) { | |
$number = [int]$deviceOrDisk.Substring(12) | |
If ($number -gt 25) { | |
Write-Error ">25 unsupported!" |
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
# zunächst brauchen wir eine Windows Runtime Referenz | |
Add-Type -AssemblyName System.Runtime.WindowsRuntime | |
# dann die passende API-Laden, https://docs.microsoft.com/en-us/uwp/api/windows.foundation.metadata.apiinformation | |
[Windows.Foundation.Metadata.ApiInformation,Windows.Foundation.UniversalAPIContract,ContentType=WindowsRuntime] | |
# Featureabfrage | |
[Windows.Foundation.Metadata.ApiInformation]::IsTypePresent("Windows.Media.Playlists.Playlist") | |
# oder API-Contract mit Version | |
[Windows.Foundation.Metadata.ApiInformation]::IsApiContractPresent("Windows.Foundation.UniversalApiContract", 1,0) | |
# bisher bekannte API-Contracts: https://docs.microsoft.com/en-us/uwp/extension-sdks/windows-universal-sdk | |
# genauer: https://docs.microsoft.com/en-us/uwp/extension-sdks/ |
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
# Grundlage: Diese geniale Antwort auf Superuser: https://superuser.com/questions/1168551/turn-on-off-bluetooth-radio-adapter-from-cmd-powershell-in-windows-10/1293303#1293303 | |
# Das Besondere daran, die Verwendung von Async und Await mit WindowsRuntime und alles in purem Powershell! | |
# hier nur die BluetoothVariante aber man kann durch Ändern der Kind-Abrage nach Wifi, MobileBroadband, FM und Other vorgehen. https://docs.microsoft.com/en-us/uwp/api/windows.devices.radios.radiokind | |
Function Bluetooth { | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$BluetoothStatus | |
) | |
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
using Microsoft.Win32; | |
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.IO; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
/// <summary> | |
/// A small class to recover Firefox Data |
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-PwnedPasswordCounter ($password) { | |
# Hashstring erzeugen | |
$sha1=[System.Security.Cryptography.SHA1]::Create() | |
$sha1Hash=$sha1.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($password)) | |
$sha1HashString=[System.BitConverter]::ToString($sha1Hash).Replace('-','') | |
$hashPrefix=$sha1HashString.Substring(0,5) | |
$hashSuffix=$sha1HashString.Substring(5) | |
# pwnedpasswords-API anrufen |
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
# | |
Add-Type -AssemblyName "System.Drawing" | |
Add-Type -AssemblyName "System.Windows.Forms" | |
function Get-VMScreenBMP { | |
param | |
( | |
$VMName, | |
$index=0 | |
) |
NewerOlder