Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #18

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ To install dotfiles clone the repository and run ./wsl-install
```bash
cd /u
git clone https://github.com/directbuy/dotfiles
cd dotfiles
/bin/bash ./wsl-install
```

Expand Down
87 changes: 86 additions & 1 deletion posh/profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function djsp() {

#>
function weather {
params(
param(
[string]$city="Chicago"
)
$weather = (Invoke-WebRequest "https://wttr.in/${city}" -UserAgent "curl").content
Expand All @@ -345,6 +345,91 @@ function weather {
}
}

<#
.cdm / .cdo
change to our working code in U directory
#>
function cu {
param([string]$subdir="m")
$dirName = "Maintenance"
if ($subdir -eq "o")
{ $dirName = "OAKAPI" }
if ($subdir -eq "t")
{ $dirName = "TMS" }
cd c:/u/$dirName
}

function tms {
$devenvPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe"
$tmsPath = "C:\u\TMS\TMS.sln"
$tmsapiPath = "C:\u\TMSApi\TMSApi.sln"

& $devenvPath $tmsPath
& $devenvPath $tmsapiPath
}

function dashboard {
$devenvPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe"
$maintenancePath = "C:\u\Maintenance\Maintenance.sln"
$oakapiPath = "C:\u\OAKApi\OAKApi.sln"

& $devenvPath $maintenancePath
& $devenvPath $oakapiPath
}

function nodeclean {
$nodeModulesDir = "C:/u/Maintenance/node_modules"
$bundlesDir = "C:/u/Maintenance/wwwroot/js/bundles"

if (test-path $nodeModulesDir) {
Remove-Item -LiteralPath "C:/u/Maintenance/node_modules" -Force -Recurse
}
if (test-path $bundlesDir) {
Remove-Item -LiteralPath "C:/u/Maintenance/wwwroot/js/bundles" -Force -Recurse
}
cd "c:/u/Maintenance" -and npm install -and npm run build
}

function restart_site() {
$userCredential = Get-Credential;
$serverName = Read-Host "Server name";
Invoke-Command -Computername $serverName -credential $userCredential -Scriptblock {
(Import-Module WebAdministration);
$websiteName = Read-Host "Website name";
Stop-Website -Name $websiteName;
Start-Website -Name $websiteName;
}
}

function stop_site() {
$userCredential = Get-Credential;
$serverName = Read-Host "Server name";
Invoke-Command -Computername $serverName -credential $userCredential -Scriptblock {
(Import-Module WebAdministration)
$websiteName = Read-Host "website name";
Stop-Website -Name $websiteName;
}
}

function oakapi_sqlscripts {
$server = "USASQL01\TSTEST"
$username = "dashboard"
$password = "dashboard"

Write-Output "RUNNING SQL FILES FOR OAKTS_TEST"
$files = Get-ChildItem "C:\u\OAKApi\API\sql_scripts\OAKTS scripts" -Filter *.sql
foreach ($file in $files) {
Write-Output "File: " $file.FullName
invoke-sqlcmd -InputFile $file.FullName -ServerInstance $server -username $username -Password $password -Database "OAKTS_TEST"
}
Write-Output "RUNNING SQL FILES FOR OAKTS_DOCS"
$files = Get-ChildItem "C:\u\OAKApi\API\sql_scripts\OAKTS_DOCS" -Filter *.sql
foreach ($file in $files) {
Write-Output "File: " $file.FullName
invoke-sqlcmd -InputFile $file.FullName -ServerInstance $server -username $username -Password $password -Database "OAKTS_DOCS"
}
}

$env:virtual_env_disable_prompt=1
function global:prompt {
$dir = "$pwd".toLower().replace("\", "/");
Expand Down