Skip to content

Instantly share code, notes, and snippets.

@jonasbfranco
Last active February 24, 2023 13:08
Show Gist options
  • Save jonasbfranco/235bb73b02b6e364859b78057c8a92ef to your computer and use it in GitHub Desktop.
Save jonasbfranco/235bb73b02b6e364859b78057c8a92ef to your computer and use it in GitHub Desktop.

Revisions

  1. jonasbfranco revised this gist Feb 24, 2023. No changes.
  2. jonasbfranco revised this gist Feb 24, 2023. 1 changed file with 60 additions and 5 deletions.
    65 changes: 60 additions & 5 deletions Microsoft.PowerShell_profile.ps1
    Original file line number Diff line number Diff line change
    @@ -4,25 +4,60 @@
    # Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
    # Install-Module posh-git -Scope CurrentUser
    # Install-Module oh-my-posh -Scope CurrentUser
    # winget install JanDeDobbeleer.OhMyPosh -s winget
    # Install-Module -Name PSReadLine -AllowClobber -Force
    # Get-PoshThemes
    # Set-PSReadLineOption -PredictionSource History
    # Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
    # Install-Module -Name Terminal-Icons -Repository PSGallery


    #### Instalar as Fontes
    # https://github.com/jonasbfranco/meslo_font.git
    # Copiar as fontes para c:\windows\fonts

    ## ESTOU USANDO ESTAS
    # Instalar Fonte fira code nerd fonts
    # https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/FiraCode.zip

    #### Local onde fica armazenado o arquivo
    # C:\Users\seu_usuario\Documents\WindowsPowerShell


    #### Nome do arquivo
    # Microsoft.PowerShell_profile.ps1


    #### Para abrir este arquivo, digitar no powershell
    # code $PROFILE e inserir estas linhas.


    ### Recaregar perfil
    # . $profile



    oh-my-posh init pwsh | Invoke-Expression

    # Configurações do PowerShell
    # Importar os temas do oh-my-posh e utilizar o Star
    Import-Module posh-git
    Import-Module oh-my-posh
    Set-PoshPrompt -Theme jandedobbeleer
    Import-Module -Name Terminal-Icons


    #Get-ChildItem
    #Get-ChildItem | Format-List
    #Get-ChildItem | Format-Wide


    #Set-PoshPrompt -Theme jandedobbeleer
    #Set-PoshPrompt -Theme robbyrussell
    #Set-PoshPrompt -Theme Star
    #Set-PoshPrompt -Theme stelbent.minimal
    #Set-PoshPrompt -Theme microverse-power
    #Set-PoshPrompt -Theme Paradox


    # Autocomplete, keybinds e histórico de comandos
    Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
    @@ -34,8 +69,28 @@ Set-PSReadlineOption -HistorySearchCursorMovesToEnd
    Set-PSReadlineOption -ShowToolTips
    Set-PSReadlineOption -PredictionSource History

    # clear

    Clear-Host
    Write-Host "Jonas"
    $DefaultUser = 'jonas'
    # Chocolatey profile
    $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
    if (Test-Path($ChocolateyProfile)) {
    Import-Module "$ChocolateyProfile"
    }


    #Clear-Host
    #Write-Host "jonas.franco"
    #$DefaultUser = 'jonas'


    ### TEMAS
    #oh-my-posh init pwsh --config 'C:\Users\jonas.franco\AppData\Local\oh-my-posh\themes\jandedobbeleer.omp.json' | Invoke-Expression
    #oh-my-posh init pwsh --config 'C:\Users\jonas.franco\AppData\Local\oh-my-posh\themes\M365Princess.omp.json' | Invoke-Expression
    #oh-my-posh init pwsh --config 'C:\Users\jonas.franco\AppData\Local\oh-my-posh\themes\the-unnamed.omp.json' | Invoke-Expression
    oh-my-posh init pwsh --config 'C:\Users\jonas.franco\AppData\Local\oh-my-posh\themes\di4am0nd.omp.json' | Invoke-Expression

    ## Ou setar em um arquivo
    # Set-PoshPrompt -Theme ~/pwsh10k.omp.json


    ## Adicionar modulos em arquivo
    #oh-my-posh --init --shell pwsh --config ~/ohmyposh.json | Invoke-Expression
  3. jonasbfranco revised this gist Jan 13, 2022. 1 changed file with 18 additions and 3 deletions.
    21 changes: 18 additions & 3 deletions Microsoft.PowerShell_profile.ps1
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,23 @@
    #### Para abrir este arquivo, digitar no powershell
    # code $PROFILE e inserir estas linhas.
    #### Primeiros passos
    # Instalar com os comandos abaixo, abrir PowerShell como administrador
    #
    # Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
    # Install-Module posh-git -Scope CurrentUser
    # Install-Module oh-my-posh -Scope CurrentUser

    #### Instalar as Fontes
    # https://github.com/jonasbfranco/meslo_font.git
    # Copiar as fontes para c:\windows\fonts

    #### Local onde fica armazenado o arquivo
    # C:\Users\seu_usuario\Documents\WindowsPowerShell

    #### Nome do arquivo
    # Microsoft.PowerShell_profile.ps1

    #### Para abrir este arquivo, digitar no powershell
    # code $PROFILE e inserir estas linhas.

    # Configurações do PowerShell
    # Importar os temas do oh-my-posh e utilizar o Star
    Import-Module posh-git
    @@ -23,4 +34,8 @@ Set-PSReadlineOption -HistorySearchCursorMovesToEnd
    Set-PSReadlineOption -ShowToolTips
    Set-PSReadlineOption -PredictionSource History

    clear
    # clear

    Clear-Host
    Write-Host "Jonas"
    $DefaultUser = 'jonas'
  4. jonasbfranco created this gist Jan 13, 2022.
    26 changes: 26 additions & 0 deletions Microsoft.PowerShell_profile.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #### Para abrir este arquivo, digitar no powershell
    # code $PROFILE e inserir estas linhas.

    #### Local onde fica armazenado o arquivo
    # C:\Users\seu_usuario\Documents\WindowsPowerShell

    #### Nome do arquivo
    # Microsoft.PowerShell_profile.ps1

    # Configurações do PowerShell
    # Importar os temas do oh-my-posh e utilizar o Star
    Import-Module posh-git
    Import-Module oh-my-posh
    Set-PoshPrompt -Theme jandedobbeleer

    # Autocomplete, keybinds e histórico de comandos
    Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
    Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
    Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
    Set-PSReadlineOption -HistorySearchCursorMovesToEnd

    # Autosugestões do PSReadline
    Set-PSReadlineOption -ShowToolTips
    Set-PSReadlineOption -PredictionSource History

    clear