Copy-Item
https://technet.microsoft.com/en-us/library/ee156818.aspx
- Copy a file from source directory to destination directory
Copy-Item c:\source\file.txt c:\destination
- Copy all files from source directory to destination directory
# Get-Uptime.ps1 | |
# Written by Bill Stewart (bstewart@iname.com) | |
# | |
# Outputs uptime for one or more computers. Uptime is determined by the | |
# LastBootUpTime property from the Win32_OperatingSystem WMI class. | |
#requires -version 2 | |
<# | |
.SYNOPSIS |
# Get-DirStats.ps1 | |
# Written by Bill Stewart | |
# Outputs file system directory statistics. | |
#requires -version 2 | |
<# | |
.SYNOPSIS | |
Outputs file system directory statistics. |
# Base64 algorithm borrowed from https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64 | |
function ConvertTo-Base64String ($string) | |
{ | |
$base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
$result = [System.Text.StringBuilder]::new() | |
$pad = "" | |
$count = $string.Length % 3; | |
# string needs to be multiple of 3 characters |
{ | |
"extends": ["airbnb-base"], | |
"env": { | |
"browser":true, | |
"commonjs": true, | |
"node": true, | |
"es6": true | |
}, | |
"rules": { |
{ | |
"printWidth": 120, | |
"singleQuote": true, | |
"useTabs": false, | |
"tabWidth": 2, | |
"semi": true, | |
"bracketSpacing": true | |
} |
const spawn = require('cross-spawn'); | |
const path = require('path') | |
const ls = spawn.sync('npm', ['ls','--json']); | |
const tree = JSON.parse(ls.stdout) | |
const walkDepTree = (tree,cb) => { | |
const deps = tree.dependencies | |
if(deps) { |
#!/usr/bin/env node | |
console.log('yay gist') |
rsync -a --exclude='.git/' /a /b |
Copy-Item
https://technet.microsoft.com/en-us/library/ee156818.aspx
Copy-Item c:\source\file.txt c:\destination
<?php | |
/** | |
* Convert a SimpleXML object to an associative array | |
* | |
* @param object $xmlObject | |
* | |
* @return array | |
* @access public | |
*/ |