I hereby claim:
- I am gravcat on github.
- I am nthieling (https://keybase.io/nthieling) on keybase.
- I have a public key ASBh5RivFs-YlicPCROrBXDSOmilWh6Sr67-_ucBdHkXSQo
To claim this, I am signing this object:
#Requires -Version 4.0 | |
#Requires -RunAsAdministrator | |
$ErrorActionPreference = "Stop" | |
$userHome = (Get-ChildItem Env:USERPROFILE).Value | |
cd $PSScriptRoot | |
$confirmation = Read-Host "This script will extract files to your Documents and Program Files (x86) folders, proceed? [y/n]" | |
while($confirmation -ne "y") | |
{ |
"Unblocking" file(s) in Windows via PowerShell |
--- | |
- hosts: all | |
tasks: | |
- name: Check for WSL feature enablement | |
win_shell: "(Get-WindowsOptionalFeature -Online -FeatureName 'Microsoft-Windows-Subsystem-Linux').State" | |
register: wsl_check | |
- name: Install WSL Feature | |
win_shell: "{{ item }}" | |
with_items: |
New-Item -ItemType File C:\helloworld.txt |
#!/bin/bash | |
# export deployment info from mcp | |
timestamp=$(date +"%Y%m%d-%H%M") | |
# create directory in home based on timestamp like 20180221-1058, cd into | |
mkdir ~/$timestamp | |
cd ~/$timestamp | |
# export data from mongo |
--- | |
- hosts: windows | |
tasks: | |
- name: ping | |
win_ping: |
I hereby claim:
To claim this, I am signing this object:
Write-Output "Configuring UAC to not prompt Administrators" | |
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0x0 /f | |
Write-Output "Creating directories" | |
if (!(Test-Path "C:\_maintainer")) { | |
New-Item -Type Directory "C:\_maintainer" | |
} | |
cd "C:\_maintainer" | |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1" -OutFile "ConfigureRemotingForAnsible.ps1" |
function New-RandomComplexPassword ($length=12) | |
{ | |
$Assembly = Add-Type -AssemblyName System.Web | |
$password = [System.Web.Security.Membership]::GeneratePassword($length,2) | |
return $password | |
} |
# https://blogs.technet.microsoft.com/stefan_stranger/2017/07/31/using-azure-custom-script-extension-to-execute-scripts-on-azure-vms/ | |
Enter-PSSession -ComputerName $comp -Credential $credential -UseSSL -SessionOption (New-PsSessionOption -SkipCACheck -SkipCNCheck) |