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 SelectItem { | |
<# | |
.SYNOPSIS | |
Selects an item from a provided list based on keyboard input. | |
.DESCRIPTION | |
The SelectItem function allows the user to select an item from a given list of strings by typing the first letter of the | |
item. The function iterates through the items that start with the given letter, allowing the user to press the same letter | |
repeatedly to cycle through the options. Selection is confirmed with the Enter key. |
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
$RegUninstallPaths = @( | |
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', | |
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' | |
) | |
$VersionsToKeep = @('Java 8 Update 261') | |
Get-CimInstance -ClassName 'Win32_Process' | Where-Object {$_.ExecutablePath -like '*Program Files\Java*'} | | |
Select-Object @{n='Name';e={$_.Name.Split('.')[0]}} | Stop-Process -Force | |
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
# Initialize timer variables | |
$timerStart = $null | |
$elapsedTime = $null | |
# Function to display elapsed time | |
function DisplayElapsedTime { | |
param ( | |
[ref]$startTime, | |
[ref]$elapsedTime | |
) |
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
$resourceGoupName = 'skylinespsdemo' | |
$azureRegion = 'East US' | |
$vmName = 'MYVM' | |
#region Create the resource group | |
New-AzResourceGroup -Name $resourceGoupName -Location $azureRegion | |
#endregion | |
#region Create the vNet for the VM | |
$newSubnetParams = @{ |
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
#ifndef EMPLOYEE_SALARY_SLIP_H_INCLUDED | |
#define EMPLOYEE_SALARY_SLIP_H_INCLUDED | |
#include <iostream> | |
#include <string> | |
#include "Employee.h" | |
using namespace std; | |
class EmployeeSalarySlip : public Employee { |
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
#region Ensure the WinRm service is running | |
Set-Service -Name "WinRM" -StartupType Automatic | |
Start-Service -Name "WinRM" | |
#endregion | |
#region Enable PS remoting | |
if (-not (Get-PSSessionConfiguration) -or (-not (Get-ChildItem WSMan:\localhost\Listener))) { | |
Enable-PSRemoting -SkipNetworkProfileCheck -Force | |
} | |
#endregion |
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 you're using 2.0+ of the azurevm provider to get the azurerm_windows_virtual_machine reosurce and | |
## the other resources and capabilities | |
provider "azurerm" { | |
version = "2.0.0" | |
features {} | |
} | |
## Create an Azure resource group using the value of resource_group and the location of the location variable | |
## defined in the terraform.tfvars file. | |
resource "azurerm_resource_group" "monolithRG" { |
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
"Pester - Describe block (Unit Test, Exported Function)": { | |
"prefix": "descu", | |
"body": [ | |
"describe '${name}' {", | |
"", | |
"\t$$commandName = '${name}'", | |
"", | |
"\tcontext 'Help' {", | |
"\t\t", |
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
#requires -Module ActiveDirectory | |
$dnsServer = '' ## This is the server name as a NETBIOS or FQDN | |
$OutputFilePath = 'C:\DNSDebugLogSummary.csv' ## The CSV file that will be created | |
## The log file you specified in the debug logging dialog box | |
$DnsDebugLogFilePath = "\$dnsServer\c$\DnsDebugLog.log" | |
## Find all of the DNS server IPs in the current domain | |
$DnsServerIPs = ((Get-ADDomain).ReplicaDirectoryServers | Resolve-DnsName).IPAddress |
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 Set-RegistryValueForAllUsers { | |
<# | |
.SYNOPSIS | |
This function uses Active Setup to create a "seeder" key which creates or modifies a user-based registry value | |
for all users on a computer. If the key path doesn't exist to the value, it will automatically create the key and add the value. | |
.EXAMPLE | |
PS> Set-RegistryValueForAllUsers -RegistryInstance @{'Name' = 'Setting'; 'Type' = 'String'; 'Value' = 'someval'; 'Path' = 'SOFTWARE\Microsoft\Windows\Something'} | |
This example would modify the string registry value 'Type' in the path 'SOFTWARE\Microsoft\Windows\Something' to 'someval' | |
for every user registry hive. |
NewerOlder