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
$fileWordArray = [System.IO.File]::ReadAllLines("C:\Users\joshu\dev\temp\powershell\something.txt") | |
Write-Host "Begin: fileWordArray ----------------------------------------------------------------" | |
Write-Host $fileWordArray | |
Write-Host "Items in file: " $fileWordArray.Length | |
foreach ($word in $fileWordArray) { | |
Write-Host $word | |
} |
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
Set-Location -Path "C:\WINRM" | |
$ErrorActionPreference = "Stop" | |
Import-Module BitsTransfer | |
$opensslPath = "$ENV:HOMEDRIVE\OpenSSL-Win32" | |
if($PSVersionTable.PSVersion.Major -lt 4) { | |
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition |
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
--- | |
- hosts: all | |
become: true | |
vars_prompt: | |
- name: ssh_username | |
prompt: Enter SSH username | |
private: false | |
- name: tpot_username |
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
terraform { | |
required_providers { | |
digitalocean = { | |
source = "digitalocean/digitalocean" | |
version = "~> 2.0" | |
} | |
} | |
} | |
# Set the variable value in *.tfvars file |
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
<?xml version="1.0" encoding="utf-8"?> | |
<unattend xmlns="urn:schemas-microsoft-com:unattend"> | |
<servicing/> | |
<settings pass="windowsPE"> | |
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> | |
<DiskConfiguration> | |
<Disk wcm:action="add"> | |
<CreatePartitions> | |
<CreatePartition wcm:action="add"> | |
<Order>1</Order> |
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
# PowerShell Script to Count Occurrences of Regular Expressions in a File | |
# Specify the path to the file | |
$filePath = "C:\Users\redacted\test.txt" | |
# Define the list of regular expressions to search for | |
$regexPatterns = @("\bwinget\b", "\bmsstore\b", "\bUnknown\b") | |
# Check if the file exists | |
if (Test-Path $filePath) { |
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
# Input CLI params with default values | |
param ( | |
$number=1, | |
$shape="Square", | |
$color="Blue" | |
) | |
try { | |
# Ordered hash table | |
[hashtable]$hash = [ordered]@{Number = $number; Shape = $shape; Color = $color} |
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
############################################################ | |
# Powershell script to remove shit features bundled in Windows 10 | |
# Removes junk bundled with Windows 10 | |
# App list: https://www.howtogeek.com/224798/how-to-uninstall-windows-10s-built-in-apps-and-how-to-reinstall-them/ | |
# King shit: https://care.king.com/en/candy-crush-soda-saga/how-to-remove-candy-crush-soda-saga-from-windows-10-with-a-powershell-command | |
# Author: Joshua Haupt josh@hauptj.com Date: 19.12.2017 | |
############################################################ | |
##### Remove Awesome Features ##### |
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
/* | |
DESC: writes to new file | |
IN: output file: outFile, string of contents to write: contents | |
OUT: nill on success | |
*/ | |
func write_file(outFile, contents string) error { | |
err := ioutil.WriteFile(outFile, []byte(contents), 0644) | |
if err != nil { | |
panic(err) |
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
listener wordpresssslv6 { | |
address [ANY]:443 | |
secure 1 | |
keyFile /usr/local/lsws/conf/example.key | |
certFile /usr/local/lsws/conf/example.crt | |
map wordpress example.com, www.example.com | |
} |
NewerOlder