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
# Version 1.2.12 | |
# check if newer version | |
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e" | |
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version') | |
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)" | |
if ([System.IO.File]::Exists($latestVersionFile)) { | |
$latestVersion = [System.IO.File]::ReadAllText($latestVersionFile) | |
$currentProfile = [System.IO.File]::ReadAllText($profile) |
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
// Discord all events! | |
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!) | |
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client | |
// Learn from this, do not just copy it mofo! | |
// | |
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584 | |
/* | |
koad-was-here |
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 Get-ServicingStackInfos { | |
Param( | |
) | |
$Hash = @{} | |
$Updates = Get-WsusUpdate | |
Foreach($Update in $Updates){ | |
#2021-01 Servicing Stack Update für Windows Server 2019 für x64-basierte Systeme (KB4598480) |
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 works | |
## Content of C:\Plop.ps1 | |
Write-host "plop" | |
# Code to import a script file as function | |
$Content = Get-Content C:\plop.ps1 -raw |
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
{ | |
#%APPDATA%\Code\User\settings.json | |
"terminal.integrated.shell.osx": "C:/Program Files/PowerShell/7/pwsh.exe", | |
"files.defaultLanguage": "powershell" | |
} |
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 works | |
## Content of C:\Plop.ps1 | |
Write-host "plop" | |
# Code to import a script file as function | |
$Content = Get-Content C:\plop.ps1 -raw |
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 Add-WinRMDaclRule { | |
<# | |
.SYNOPSIS | |
Add a Discretionary Acl rule to the root WinRM listener or individual PSSession configuration. | |
.DESCRIPTION | |
Add a Discretionary Acl rule to the root WinRM listener or individual PSSession configuration. | |
This can be useful if you wish to give access to an individual user or group to either the root WinRM listener or | |
a specific PSSession configuration that is not an Administrator. |
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
$HTML = html { | |
head { | |
Write-PSHTMLAsset # This simple command will add a local link to the Jquery / Chartjs and bootstrap frameworks. | |
# It wil allow to work with them without internet connection BUT it won't work if you send you html document per mail for example as it needs the ref to the local files. | |
} | |
body { |
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
$HTML = html { | |
head { | |
Write-PSHTMLAsset # This simple command will add a local link to the Jquery / Chartjs and bootstrap frameworks. | |
# It wil allow to work with them without internet connection BUT it won't work if you send you html document per mail for example as it needs the ref to the local files. | |
} | |
body { |
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
Vagrant.configure("2") do |config| | |
config.vm.provision "shell", inline: "echo Hello" | |
config.vm.define "ansiblesrv" do |ansiblesrv| | |
ansiblesrv.vm.box = "centos/7" | |
ansiblesrv.vm.provision "shell", inline: <<-SHELL | |
sudo yum update | |
sudo yum install ansible -y | |
sudo yum install epel-release -y | |
sudo yum install python-pip -y |
NewerOlder