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
| <############# | |
| 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 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
| # 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 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
| 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 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
| Write-Output "Hello!" | Out-File C:\Users\nucleus\Desktop\hello.txt |
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
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # |
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
| #requires –runasadministrator | |
| try | |
| { | |
| & choco -h | |
| } | |
| catch | |
| { | |
| # If chocolatey help wasn't available, invoke expression to install from Chocolatey.org | |
| iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
| } |
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
| # must be run in administrator context | |
| param ( | |
| [String] $path, # file or folder | |
| [String] $perm, # fullcontrol, read, write, etc | |
| [String] $action = "allow" #allow or deny | |
| [String] $user | |
| ) | |
| $arguments = $user, $perm, $action |
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
| # to be run in any normal user-spawned powershell prompt | |
| Start-Process powershell -Verb runas -argumentlist "& lxrun /install /y" |
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
| <# ----------------------------------------------------------------------------- | |
| bootstrap_w10_orch.ps1 | |
| .Description | |
| Get a Windows 10 box into a state where SSH is ready and available. | |
| Also try to get Windows Subsystem for Linux (WSL) prepped and ready. | |
| When run via CSE, this script is downloaded into: | |
| C:\Packages\... | |
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
| <# ----------------------------------------------------------------------------- | |
| Check-LinuxOS() | |
| .Description | |
| Check whether or not a host you are running from is Linux. WMI is not yet | |
| available in the PowerShell alpha. | |
| ----------------------------------------------------------------------------- #> | |
| function Check-LinuxOS { | |
| $ErrorActionPreference = "SilentlyContinue" # Prevents stop when Windows explodes with uname call |