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 Get-RandomUser { | |
<# | |
.SYNOPSIS | |
Generate random user data. | |
.DESCRIPTION | |
This function uses the free API for generating random user data from https://randomuser.me/ | |
.EXAMPLE | |
Get-RandomUser 10 | |
.EXAMPLE | |
Get-RandomUser -Amount 25 -Nationality us,gb -Format csv -ExludeFields picture |
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
<# | |
.SYNOPSIS | |
Uses XML transformation on a specified XML file | |
.DESCRIPTION | |
Performs XML configuration changes to a given XML file via XML-Document-Transform (XDT) commands specified within a seperate XML file. | |
.EXAMPLE | |
PS C:\> Use-XMLTransform -XML 'D:\myApp\app.config' -XDT 'D:\myApp\app.release.config' | |
Transforms configuration within app.config using the XDT commands found in app.release.config | |
.INPUTS | |
String literal paths to XML/XDT docs and optionally XmlTransform.dll |
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
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(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
function Format-Wide { | |
[CmdletBinding(HelpUri='http://go.microsoft.com/fwlink/?LinkID=113304')] | |
param( | |
[Parameter(Position=0)] | |
[System.Object] | |
${Property}, | |
[switch] | |
${AutoSize}, |
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 Get-Spreadsheet { | |
param( | |
[Parameter(Mandatory = $true)] | |
[ValidateScript({ Test-Path $_ -PathType Leaf })] | |
[string]$Path | |
) | |
try { | |
[DocumentFormat.OpenXml.Packaging.SpreadsheetDocument] | Out-Null | |
} | |
catch { |
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
<# | |
.SYNOPSIS | |
Creates a new alias. Better than original New-Alias | |
.DESCRIPTION | |
Creates a new Function Alias. Unlike the original New-Alias, this will let you | |
create an alias that can be a command line or script, in a single command. |
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
# | |
# Copyright (c) Microsoft Corporation. All rights reserved. | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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
#requires -version 4.0 | |
Function Convert-CSVtoXLS { | |
<# | |
.SYNOPSIS | |
This function converts a CSV file to an Excel workbook. | |
.DESCRIPTION | |
Convert-CSVtoXLS converts a csv file to a Excel workbook. | |
The first line of the CSV file is turned into a filtering header. | |
Excel must be installed on the computer. |
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
var searchterm='ACME Corporation'; //text to search for | |
//this is the decoded base64 string from the global search url | |
var stringToEncode = '{"componentDef":"forceSearch:search","attributes":{"term":"'+searchterm+'","scopeMap":{"resultsCmp":"forceSearch:resultsTopResults","label":"Top Results","type":"TOP_RESULTS","cacheable":"Y","id":"TOP_RESULTS","labelPlural":"Top Results"},"context":{"disableSpellCorrection":false,"SEARCH_ACTIVITY":{"term":1234567890}}},"state":{}}'; | |
//convert to base64encode | |
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za- |
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
#if winActive("ahk_class #32770") ; "save", "save as" or "open" | |
^+l::goSub, list_open_folders | |
#if | |
list_open_folders: | |
for a in comObjCreate("shell.application").windows | |
{ | |
if !inStr(a.document.folder.self.path, "::{") ; ignore recycle bin & my pc | |
menu, open_folders, add, % a.document.folder.self.path, goto_open_folder |
OlderNewer