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
SyncToyCmd –R “MyBackupPlan” |
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 Exists-Drive ($driveletter) | |
{ | |
$drive = New-Object System.IO.DriveInfo($driveletter) | |
$drive.DriveType -ne 'NoRootDirectory' | |
} |
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 Mount-Codebox | |
{ | |
$scriptFile = “D:\VBox\HardDrives\AttachVHD.cmd” | |
& $scriptFile | |
} |
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
DiskPart -s "c:\AttachMyVHD.s" |
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
select vdisk file=c:\MyVHD.vhd | |
attach vdisk |
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-SqlServiceStatus ($serviceName) | |
{ | |
# Get a reference to the service | |
$sqlService = Get-Service $serviceName | |
# Return the service status | |
return $sqlService.status | |
} |
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
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" 'D:\Folder Name\Our Script.ps1' |
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
Set-ExecutionPolicy –ExecutionPolicy Unrestricted |
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
Get-ExecutionPolicy |
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
// This script uses Node.js | |
// the 'arrayFile.json' is in the same folder as where you're running this command. | |
// This is not a script, but just the commands. Run from the shell. | |
// Sample item from the JSON file: | |
// { "id": "1" , "name": "one" } | |
// Files are saved under the folder 'itemsFolder', each item is saved in a JSON file name '<id>.json'. | |
var itemsArray = require('./arrayFile.json'); | |
itemsArray.forEach( function (item) { item.writeFileSync('itemsFolder/' + item.id + '.json', JSON.stringify(item) ); } ); |