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
using namespace System.Collections | |
using namespace System.Management.Automation | |
using namespace System.ComponentModel.DataAnnotations | |
using namespace System.Runtime.Serialization | |
class MandatoryProperties { | |
MandatoryProperties([IDictionary]$properties) { | |
$this.GetType().GetProperties([System.Reflection.BindingFlags]'Instance,Public') | ForEach-Object { | |
$propertyName = $PSItem.Name | |
[bool]$isOptional = $PSItem.GetCustomAttributes([OptionalFieldAttribute], $true).count -gt 0 | |
if ( |
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
# You Should be able to Copy and Paste this into a powershell terminal and it should just work. | |
# To end the loop you have to kill the powershell terminal. ctrl-c wont work :/ | |
# Http Server | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
$http.Prefixes.Add("http://localhost:8080/") |
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
# The default is High. Setting it here for clarity. | |
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-5.1 | |
$ConfirmPreference = 'High' | |
[CmdletBinding(SupportsShouldProcess=$true)] | |
param( | |
[switch]$Force | |
) | |
# Use this to prompt the user by default. Use the -Force parameter to disable prompting. |
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
#requires -version 2 | |
<# | |
.SYNOPSIS | |
Time-base One-Time Password Algorithm (RFC 6238) | |
.DESCRIPTION | |
This is an implementation of the RFC 6238 Time-Based One-Time Password Algorithm draft based upon the HMAC-based One-Time Password (HOTP) algorithm (RFC 4226). This is a time based variant of the HOTP algorithm providing short-lived OTP values. | |
.NOTES | |
Version: 1.0 |