Skip to content

Instantly share code, notes, and snippets.

@danmaq
danmaq / rund4wsl.sh
Last active August 13, 2016 07:06
/etc/rcX.d/AllScripts launcher for "Ubuntu on Windows". Usage: sudo rund4wsl.sh -l <runlevel> -o <start|stop>
#!/bin/bash
failed()
{
echo $1 1>&2
exit 1
}
usage()
{
failed "Usage: sudo $0 -l <runlevel> -o <start|stop>"
@meziantou
meziantou / CredentialManager.cs
Last active March 12, 2024 02:35
Using the Windows Credential API (CredRead, CredWrite, CredDelete, CredEnumerate).
// The most up to date version is available
// on GitHub: https://github.com/meziantou/Meziantou.Framework/tree/master/src/Meziantou.Framework.Win32.CredentialManager
// NuGet package: https://www.nuget.org/packages/Meziantou.Framework.Win32.CredentialManager/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32.SafeHandles;
@cdhunt
cdhunt / Get-CredentialFromWindowsCredentialManager.ps1
Last active June 1, 2023 23:48 — forked from toburger/Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential [PSCredential] from the Windows Credential Manager. This only works for Generic Credentials.
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The
Get-StoredCredential function can only access Generic Credentials.
Alias: GSC