Skip to content

Instantly share code, notes, and snippets.

@newyear2006
newyear2006 / ConvertDeviceName.PS1
Created August 25, 2018 20:14
Konvertiert Linux-SCSI Devicenamen wie /dev/sda nach Windows PhysicalDrive0 Namen und zurück
# 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!"
@newyear2006
newyear2006 / Confirm-SecureBootUEFI.cs
Created September 22, 2018 16:23
Versuch Confirm-SecureBoot nachzubauen
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace UEFIFirmwareVariablenAbfragen
{
class Program
@newyear2006
newyear2006 / Confirm-SecureBootUEFI.PS1
Created September 22, 2018 16:25
Versuch Confirm-SecurebootUEFI in Powershell nachzubauen und UEFI-Firmware-Variablen auszulesen
# 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
{
@newyear2006
newyear2006 / ConsoleCursorOnOff.PS1
Last active October 29, 2020 13:11
Um den Konsolen Cursor in Windows mittels Powershell ein- und ausschalten zu können
$MethodDefinitions = @'
using System;
using System.Runtime.InteropServices;
public class ConsoleCursor {
[StructLayout(LayoutKind.Sequential)]
internal struct CONSOLE_CURSOR_INFO
{
internal uint Size;
@newyear2006
newyear2006 / ConvertFrom-YtTransscript.PS1
Last active April 17, 2023 13:14
Überträgt Youtube-Video-Transkripte in Objekte zur weiteren Verarbeitung
Function ConvertFrom-YtTranscript {
[CmdletBinding()]
Param(
#[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)]
[Parameter(ValueFromPipeline)]
$Transcript,
[switch]
[bool]$PreserveTime
)