This file contains 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.Windows.Forms | |
( $Form = [Form]@{ | |
Text = 'Data Entry Form' | |
Size = '1200,800' | |
StartPosition = 'CenterScreen' } | |
).Controls.AddRange(( | |
( | |
[Label]@{ | |
Location = '10,20' |
This file contains 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 Publish-SSAUDDashboard | |
{ | |
<# | |
.SYNOPSIS | |
Publish Universal Dashboard dashboard as a service. | |
Enhanced version of UD module command Publish-UDDashboard | |
.PARAMETER DisplayName | |
Display name of the service. | |
Required |
This file contains 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.Management.Automation.Runspaces | |
using namespace System.Reflection | |
function Import-PSCmdlet | |
{ | |
param ( | |
[String]$Name, | |
[Type]$Type ) | |
[PowerShell].Assembly. |
This file contains 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
$Session:Loading = $True | |
New-UDElement -Id Loading -Tag div -Endpoint { | |
If ( $Session:Loading ) | |
{ | |
New-UDCard -Content { | |
New-UDHeading -Text 'Loading data...' | |
New-UDPreloader -Size Small } | |
} | |
} |
This file contains 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
# Maze size, zero-based, not including thickness of walls | |
$XSize = 40 | |
$YSize = 10 | |
# Random location of start and end doors on left and right borders | |
$Start = Get-Random ( $YSize + 1 ) | |
$End = Get-Random ( $YSize + 1 ) | |
# Create maze object, array of cells, X, Y, P | |
# X, Y - coordinates of cell |
This file contains 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 New-UselessType | |
{ | |
<# | |
.SYNOPSIS | |
Create a new class of a given name for doing stupid tricks | |
.DESCRIPTION | |
Creates a new class derived from System.Type that allows you to cast | |
anything as type [System.String]. (It does NOT cast to a string, but | |
rather to the Type that describes a string type.) |
This file contains 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
@' | |
{ | |
"variables": [ "tenantName", "environmentType" ], | |
"type": "Vsts", | |
"name": "${tenantName}_$environmentType", | |
"description": "Variable Group for $tenantName" | |
} | |
'@ | Set-Content C:\temp\temp2.json | |
This file contains 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 test | |
{ | |
[cmdletbinding()] | |
Param ( | |
[parameter( ValueFromPipeline = $True )] | |
$X ) | |
begin | |
{ | |
Write-Host "Begin test" |
This file contains 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
# Excerpt from The PowerShell Conference Book | |
# https://LeanPub.com/Powershell-Conference-Book | |
## ConcurrentDictionary for communication with thread | |
# Define concurrent variables | |
$SharedValues = [System.Collections.Concurrent.ConcurrentDictionary[string,psobject]]@{} | |
$SharedValues['Input'] = 2 | |
# Define thread script |
This file contains 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
<# | |
Givin PHP file as follows | |
<?php | |
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */ | |
// $Id: 83b45ef5b7d38e12be4e65351c4c6e504a931ecf $ | |
$conf['user']['autocreate_special'] = false; | |
$conf['user']['allow_folders'] = true; | |
$conf['user']['allow_view_source'] = true; | |
$conf['server']['server_list'] = 'shown'; |
NewerOlder