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-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()]
$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
,
$CreateFileEndpoint = New-UDEndpoint -Url "/file/" -Method "Post" -Endpoint {
Param(
$Authorization
,
$FileName
,
$Content
)
$secretBytes = [System.Convert]::FromBase64String(($Authorization -replace "Basic "))
function Set-FileApi
{
[cmdletbinding(
SupportsShouldProcess
)]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,
function Get-FileApi
{
[cmdletbinding()]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,
[string]
$Name
$GetFileEndpoint = New-UDEndpoint -Url "/file/" -Method "GET" -Endpoint {
Param(
$Authorization
,
$Name
)
if ($request.headers.ContainsKey("Authorization"))
{
$Authorization = $request.headers["Authorization"].ToString()
function Get-FileApi
{
[cmdletbinding()]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,
[string]
$Name