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
## No | |
Do-Thing | Out-Null | |
## yes | |
$null = Do-Thing | |
[void](Do-Thing) |
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
enum Color { | |
Red | |
Green | |
Blue | |
} | |
function Set-Color { | |
param ( | |
[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
enum Color { | |
Red | |
Green | |
Blue | |
} | |
function Set-Color { | |
param ( | |
[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
enum Color { | |
Red | |
Green | |
Blue | |
} | |
function Set-Color { | |
param ( | |
[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
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
# 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
#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
################################################### | |
# This is an associated snippet on learning Azure Functions by Jeff Brown at: | |
# https://adamtheatuomator.com/azure-functions-tutorial | |
################################################### | |
# The function URL appends the function name with a question mark and a code. This code is the function key and | |
# authenticates to the function for execution. Without this key, you would not be able to trigger the function. | |
# This key provides security so not just anyone can start the function. | |
$functionKey = '' ## Fill this in from the Get function URL page | |
$functionAppName = 'ata-powershell-functions' |
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 is an associated snippet on learning Azure Functions by Jeff Brown at: | |
# https://adamtheatuomator.com/azure-functions-tutorial | |
################################################### | |
## The using statement imports the System.Net namespace, and param() defines the function's parameters. | |
using namespace System.Net | |
## Input bindings are passed in via param block. | |
## The *$Request* parameter contains the information passed to the function during the HTTP request. This information includes the request headers, request body, HTTP method, parameters, and URL of the request. |
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