<# .SYNOPSIS Helper script to run mongodb. .DESCRIPTION This script will detect mongodb, add it to the PATH and launch it on specified port and db location. .EXAMPLE PS> .\run_mongo.ps1 #> $art = @" ____________ /\ ___ \ \ \ \/_\ \ \ \ _____/ ______ ___ ___ ___ \ \ \___/ /\ \ \ \\ \\ \ \ \____\ \ \_____\ \__\\__\\__\ \/____/ \/_____/ . PYPE Club . "@ Write-Host $art -ForegroundColor DarkGreen function Exit-WithCode($exitcode) { # Only exit this host process if it's a child of another PowerShell parent process... $parentPID = (Get-CimInstance -ClassName Win32_Process -Filter "ProcessId=$PID" | Select-Object -Property ParentProcessId).ParentProcessId $parentProcName = (Get-CimInstance -ClassName Win32_Process -Filter "ProcessId=$parentPID" | Select-Object -Property Name).Name if ('powershell.exe' -eq $parentProcName) { $host.SetShouldExit($exitcode) } exit $exitcode } $current_dir = Get-Location $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent $pype_root = (Get-Item $script_dir).parent.FullName Set-Location -Path $pype_root git submodule update --recursive --remote Set-Location -Path $current_dir