Skip to content

Instantly share code, notes, and snippets.

/*Exception details:
https://fef.msub03.manage.microsoft.com/DeviceConfiguration_2010/StatelessDeviceConfigurationFEService/deviceManagement/deviceConfigurations?api-version=5020-09-25
iosWiFiConfiguration as JSON
{
"connectAutomatically": true,
"connectWhenNetworkNameIsHidden": true,
"disableMacAddressRandomization": false,
"networkName": "4999",
"preSharedKey": "ThaKey12348",
"proxySettings": "none",
function Get-NumberRange
{
[cmdletbinding()]
Param()
DynamicParam {
$Dictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary
$NewDynParam = @{
Name = "Firstnumber"
Alias = "int"
function Get-ChessScores
{
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline)]
[string]$RootPath
)
Begin {
$SharpCode = @'
function Get-LithnetAutoSyncStatus
{
<#
.Synopsis
Checks the Lithnet AutoSync Execution monitor status
.DESCRIPTION
This command checks the status of the Lithnet AutoSync execution monitor. If the monitor is started it will retun "running". If is
is not running, it will return "stopped". Cmdlet must be executed on host which has the AutoSync service installed.
More information about AutoSync is available here: https://github.com/lithnet/miis-autosync
function Test-Command
{
[cmdletbinding()]
Param()
write-verbose -Message "Start"
}
function Write-Verbose
{
[cmdletbinding()]
function Get-AuthorizationHeader
{
[cmdletbinding()]
Param(
[Parameter(
ValueFromPipeline)]
[PSCredential]
$Credential
)
$ModuleScript = {
$folders = @('functions', 'private', 'classes')
ForEach ($folder in $folders)
{
$currentPath = $PSScriptRoot | Join-Path -ChildPath $folder
If (Test-Path -Path $currentPath -PathType Container)
{
$functions = Get-ChildItem -Path $currentPath -Filter '*.ps1'
$exportFunctions = (Get-ChildItem -Path .\Functions -Filter "*.ps1").BaseName
$manifestPath = Join-Path -Path .\ -ChildPath FilesAPI.psd1
$newManifest = @{
Path = $manifestPath
Guid = ([guid]::NewGuid())
Author = "SomeDude"
CompanyName = "Contoso"
RootModule = "FilesAPI.psm1"
Description = "Awsome files module"
function Set-FileApi
{
[cmdletbinding(
SupportsShouldProcess
)]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,
function Set-FileApi
{
[cmdletbinding(
SupportsShouldProcess
)]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,