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
function Get-Test | |
{ | |
Get-Date | |
} | |
function New-TestRole | |
{ | |
New-PSRoleCapabilityFile -Path c:\TestRole.psrc ` |
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
function Get-Enum | |
{ | |
param ( | |
[type]$Type | |
) | |
[enum]::GetValues($Type) | | |
Select-Object -Property ` | |
@{ Name = 'Name'; Expression={ [string]$_ } }, | |
@{ Name = 'Value'; Expression={ [int]$_ }}, |
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
trigger: | |
- '*' | |
stages: | |
- stage: develop | |
jobs: | |
- job: A | |
strategy: | |
parallel: 4 | |
pool: |
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
[DSCLocalConfigurationManager()] | |
configuration LcmDebugConfig | |
{ | |
Node localhost | |
{ | |
Settings | |
{ | |
RefreshMode = 'Push' | |
DebugMode = 'ForceModuleImport' | |
} |
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
SELECT | |
s.session_id, | |
c.connect_time, | |
s.login_time, | |
s.login_name, | |
c.protocol_type, | |
c.auth_scheme, | |
s.HOST_NAME, | |
s.program_name | |
FROM sys.dm_exec_sessions s |
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
$vms = Get-LabVM -Role FileServer | |
$wiresharkUri = 'https://1.eu.dl.wireshark.org/win64/Wireshark-win64-3.2.2.exe' | |
$fiddlerUri = 'https://telerik-fiddler.s3.amazonaws.com/fiddler/FiddlerSetup.exe' | |
$fiddler = Get-LabInternetFile -Uri $fiddlerUri -Path $labSources\SoftwarePackages -PassThru | |
$wireshark = Get-LabInternetFile -Uri $wiresharkUri -Path $labSources\SoftwarePackages -FileName Wireshark.exe -PassThru | |
Install-LabSoftwarePackage -Path $fiddler.FullName -CommandLine /S -ComputerName $vms | |
Install-LabSoftwarePackage -Path $wireshark.FullName -CommandLine /S -ComputerName $vms |
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
param ( | |
[Parameter(Mandatory)] | |
$ResourceGroupName, | |
[Parameter(Mandatory)] | |
$VmName, | |
[Parameter(Mandatory)] | |
[ValidateSet('Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS')] | |
$StorageType, |
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
<# | |
.SYNOPSIS | |
Powerful asynchronus IPv4 Port Scanner | |
.DESCRIPTION | |
This powerful asynchronus IPv4 Port Scanner allows you to scan every Port-Range you want (500 to 2600 would work). | |
The result will contain the Port number, Protocol, Service name, Description and the Status. | |
.EXAMPLE |
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
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
mkdir -Path C:\ProgramData\Microsoft\Windows\PowerShell\PowerShellGet -Force | |
Invoke-WebRequest -Uri 'https://nuget.org/nuget.exe' -OutFile C:\ProgramData\Microsoft\Windows\PowerShell\PowerShellGet\nuget.exe -ErrorAction Stop | |
Install-PackageProvider -Name NuGet -Force | |
Install-Module -Name PowerShellGet -Force |
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
function GenerateRandomSalt | |
{ | |
[byte[]]$data = New-Object byte[](32) | |
$cp = [System.Security.Cryptography.RNGCryptoServiceProvider]::new() | |
for ($i = 0; $i -lt 10; $i++) | |
{ | |
$cp.GetBytes($data) | |
} |