Skip to content

Instantly share code, notes, and snippets.

@Kambaa
Last active November 5, 2024 08:47
Show Gist options
  • Save Kambaa/db7bfcc3d8ce9f6a35e834479d25ae87 to your computer and use it in GitHub Desktop.
Save Kambaa/db7bfcc3d8ce9f6a35e834479d25ae87 to your computer and use it in GitHub Desktop.
Windows powershell profile (like bashprofile) settings.
Clear-Host
# tab auto completion for git commands
# Install with:  PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
# more on website: https://github.com/dahlbyk/posh-git?tab=readme-ov-file#installation
Import-Module posh-git
oh-my-posh init pwsh | Invoke-Expression


function QuitReplacement{
Invoke-Command -ScriptBlock {exit}
}

New-Alias -Name q -Value QuitReplacement

$env:J17DIR = "C:\Users\kambaa\.jdks\corretto-17.0.12"
function j17 {
    $env:Path = "$env:J17DIR\bin;$env:Path"
    $env:JAVA_HOME = $env:J17DIR
    java --version
}


function ademo{
Set-Location -Path "C:\temp"
Remove-Item -Path .\* -Recurse -Force
mvn archetype:generate -DarchetypeGroupId='tr.com.mycompany' -DarchetypeArtifactId=my-archetype -DarchetypeVersion='v0.7.2'
$firstFolder = Get-ChildItem -Path "C:\temp" -Directory | Select-Object -First 1
if ($firstFolder ) {
    & 'idea' "$($firstFolder.Name)"
}
}


function gpull {
    git pull origin (git rev-parse --abbrev-ref HEAD)
}

function gpush {
    git push origin (git rev-parse --abbrev-ref HEAD)
}




function mk{
	j17; ./mvnw spotless:apply; ./mvnw checkstyle:check
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment