Last active
December 23, 2015 19:19
-
-
Save masonwan/6681417 to your computer and use it in GitHub Desktop.
PowerShell script for running stuffs on Windows
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
# From <http://blogs.msdn.com/b/powershell/archive/2007/06/19/get-scriptdirectory.aspx> | |
function Get-ScriptDirectory { | |
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $Invocation.MyCommand.Path | |
} | |
$dir = Get-ScriptDirectory | |
$cmd = $dir + '\bin\mysqladmin.exe' | |
& $cmd -u root shutdown |
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
# Put the script in your MongoDB root directory to run it anywhere. | |
# From <http://blogs.msdn.com/b/powershell/archive/2007/06/19/get-scriptdirectory.aspx> | |
function Get-ScriptDirectory { | |
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $Invocation.MyCommand.Path | |
} | |
$dir = Get-ScriptDirectory | |
$cmd = $dir + '\bin\mongod.exe' | |
$data = $dir + '\data' | |
& $cmd --dbpath $data |
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
# From <http://blogs.msdn.com/b/powershell/archive/2007/06/19/get-scriptdirectory.aspx> | |
function Get-ScriptDirectory { | |
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $Invocation.MyCommand.Path | |
} | |
$dir = Get-ScriptDirectory | |
$cmd = $dir + '\bin\mysqld.exe' | |
& $cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment