Skip to content

Instantly share code, notes, and snippets.

Tore Groneng torgro

Block or report user

Report or block torgro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Get-LithnetAutoSyncStatus.ps1
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
View log.ps1
function Test-Command
{
[cmdletbinding()]
Param()
write-verbose -Message "Start"
}
function Write-Verbose
{
[cmdletbinding()]
View HelperFunctions.ps1
function Get-AuthorizationHeader
{
[cmdletbinding()]
Param(
[Parameter(
ValueFromPipeline)]
[PSCredential]
$Credential
)
View CreateModule.ps1
$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'
View CreateManifest.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"
View Set-FileApi.ps1
function Set-FileApi
{
[cmdletbinding(
SupportsShouldProcess
)]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,
View NewSet-FileApi.ps1
function Set-FileApi
{
[cmdletbinding(
SupportsShouldProcess
)]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,
View NewCreateFileEndpoint.ps1
$CreateFileEndpoint = New-UDEndpoint -Url "/file/" -Method "Post" -Endpoint {
Param(
$Authorization
,
$FileName
,
$Content
)
$secretBytes = [System.Convert]::FromBase64String(($Authorization -replace "Basic "))
View CreateFileEndpoint.ps1
$CreateFileEndpoint = New-UDEndpoint -Url "/file/" -Method "Post" -Endpoint {
Param(
$Authorization
,
$FileName
,
$Content
)
$secretBytes = [System.Convert]::FromBase64String(($Authorization -replace "Basic "))
View newGet-FileApi.ps1
function Get-FileApi
{
[cmdletbinding()]
Param(
[Parameter(Mandatory)]
[hashtable]
$Authorization
,
[string]
$Name
You can’t perform that action at this time.