This file contains 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
Write-Output "Hello!" | Out-File C:\Users\nucleus\Desktop\hello.txt |
This file contains 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
if (!(Test-Path "C:\_maintainer")) { | |
New-Item -Type Directory "C:\_maintainer" | |
} | |
Invoke-WebRequest -Uri "https://gist.githubusercontent.com/gravcat/4ceb977916c5f551cae44375296ab72a/raw/c514ad8212460396813d88c6ffbdb0954c233eb5/modify-local-activation-dcom.ps1" ` | |
-OutFile "C:\_maintainer\modify-local-activation-dcom.ps1" | |
Add-Content -Value "lxrun /install /y" -Path "C:\_maintainer\lxrun_install.bat" | |
Add-Content -Value "copy /y nul C:\_maintainer\lxrun_install_complete" -Path "C:\_maintainer\lxrun_install.bat" |
This file contains 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
# Ensure that current process can run scripts. | |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force | |
$ErrorActionPreference = "Stop" | |
$ConfirmPreference = "none" | |
Start-Transcript $env:TEMP\patchlog.log -Force | |
try | |
{ | |
Install-Module -Name PSWindowsUpdate -Force -Verbose | |
Write-Host "Installation Started" | |
Get-WUInstall -AcceptAll -AutoReboot -Verbose |
This file contains 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
<############# | |
This was really difficult to figure out, | |
but here's a snippet that will allow you to modify DCOM ACLs. | |
Easily modified to touch other properties in DCOM ACL-land. | |
#############> | |
# get the Object based on the AppId. This example AppID belongs to the Linux Subsystem DCOM object | |
$wmi = (Get-WmiObject -Class Win32_DCOMApplicationSetting -Filter "AppId='{e82567ae-2ea4-4dbc-bc68-8b0a0526d8d5}'" -EnableAllPrivileges) | |
# get the Launch Descriptor object and store |
This file contains 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
<# ----------------------------------------------------------------------------- | |
vm_create_and_run_cse.ps1 | |
.Description | |
Create an adhoc VM completely standalone, and run CSE if you'd like. | |
Get you some OSes! : https://docs.microsoft.com/en-us/azure/virtual-machines/windows/cli-ps-findimage | |
Publishers | |
- MicrosoftWindowsServer |
This file contains 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
$ErrorActionPreference = 'SilentlyContinue' | |
$rg = "gravcat195" | |
$location = "westus" | |
$fileName = "install-wsl-nopasswd.ps1" | |
$fileUri = "https://gist.githubusercontent.com/gravcat/397b330d4154a55f76e03de5b8f7ca18/raw/be0dde4e715cef0a6aa0719f0a29242c3c954402/$fileName" | |
$cseId = "cse" | |
Set-AzureRmVMCustomScriptExtension -ResourceGroupName $rg -VMName "$rg-vm" -location 'westus' -FileUri $fileUri -run $fileName -name $cseId -Argument "-username nucleus -password W3ARhkLrdQK8" | |
Start-Sleep -Seconds 3 |
This file contains 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 New-DComAccessControlEntry { | |
param( | |
[Parameter(Mandatory=$true, Position=0)] | |
[string] | |
$Domain, | |
[Parameter(Mandatory=$true, Position=1)] | |
[string] | |
$Name, | |
This file contains 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
# @manojampalam - authored initial script | |
# @friism - Fixed issue with invalid SDDL on Set-Acl | |
# @manojampalam - removed ntrights.exe dependency | |
# @bingbing8 - removed secedit.exe dependency | |
$scriptpath = $MyInvocation.MyCommand.Path | |
$scriptdir = Split-Path $scriptpath | |
$sshdpath = Join-Path $scriptdir "sshd.exe" | |
$sshagentpath = Join-Path $scriptdir "ssh-agent.exe" |
This file contains 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
param ( | |
[String] | |
$SSHPort = "22", | |
[String] | |
$version = "v0.0.20.0", | |
[String] | |
$packageName = "OpenSSH-Win64", |
This file contains 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
param ( | |
[String] | |
$SSHPort = "22", | |
[String] | |
$version = "v0.0.20.0", | |
[String] | |
$packageName = "OpenSSH-Win64", |