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
| . .\NewXMLDocument.ps1 | |
| $rdp_domainname = "MicrosoftAccount" | |
| $rdp_username = "fred" | |
| $ssh_username = "fred" | |
| $vnc_username = "fred" | |
| $rdp_password = "changeme!" | |
| $ssh_password = "changeme!" | |
| $vnc_password = "changeme!" |
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
| { | |
| "Dynamic_Param_Start": { | |
| "prefix": "dynamic1start", | |
| "body": [ | |
| "DynamicParam {", | |
| "\t${1:dynamic2p}${2:}", | |
| "}" | |
| ], | |
| "description": "An empty dynamic parameter" | |
| }, |
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
| Import-Module -Name UniversalDashboard | |
| $ADDomain = "MyDomainHere.consto.com" | |
| $ADGroup = "GroupNameHere" | |
| $PageHome = New-UDPage -Name "Home" -Content { | |
| New-UDLayout -Columns 3 -Content { | |
| New-UDCard -Title "Scheduled" -Content { | |
| "Links" | |
| } -Links @( |
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 -Module PSSQLite | |
| param( | |
| [Alias('Name', '')] | |
| [string] | |
| $ProfileName | |
| ) | |
| <# | |
| Updated for 9/2 patch | |
| Updated by request of Truth91 | |
| #> |
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
| function Get-Factor { | |
| param ( | |
| [Parameter(Mandatory = $true, | |
| Position = 0, | |
| ValueFromPipeline = $true)] | |
| [ValidateNotNullOrEmpty()] | |
| [int64[]] | |
| $Number, | |
| [switch] |
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
| function ConvertTo-UnixTime { | |
| [OutputType([int64])] | |
| Param( | |
| # Date in UNIX time | |
| [Parameter(Mandatory, | |
| ValueFromPipeline=$true)] | |
| [DateTime] | |
| $DateTime | |
| ) | |
| [Math]::Floor([decimal](Get-Date($DateTime).ToUniversalTime() -UFormat "%s")) |
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
| function ConvertTo-Bits { | |
| <# | |
| .SYNOPSIS | |
| This converts any string, number or an array of numbers to a bit array object | |
| .DESCRIPTION | |
| This converts any string, number or an array of numbers to a bit array object | |
| .PARAMETER InputObject | |
| Accepts any object, but String or Number is expected |
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
| $Application = New-Object -ComObject PowerPoint.Application | |
| # Make PowerPoint visible during debug | |
| $Application.Visible = [Microsoft.Office.Core.MsoTriState]::msoTrue | |
| # Create a new presentation | |
| $Application.Presentations.Add([Microsoft.Office.Core.MsoTriState]::msoTrue) | |
| # Add a slide | |
| # Yes... index starts at 1... | |
| $Application.Presentations[1].Slides.Add(1,1) | |
| # Get the text of the first shape in the first slide | |
| $Application.Presentations[1].Slides[1].Shapes[1].TextFrame2.TextRange.Text |
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
| # Function to figure out what the file type is | |
| function Get-ImageExt { | |
| [CmdletBinding()] | |
| # [OutputType([System.Boolean])] | |
| param( | |
| [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] | |
| [ValidateNotNullOrEmpty()] | |
| [Alias('PSPath')] | |
| [string] $Path | |
| ) |
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
| crontab -l > mycron | |
| echo "0 2 * * * apt-get update" >> mycron | |
| echo "0 3 * * * apt-get -y dist-upgrade" >> mycron | |
| echo "0 4 * * * apt-get -y upgrade" >> mycron | |
| crontab mycron | |
| rm mycron |