{"id":20482967,"url":"https://github.com/denisgas/ps_profile","last_synced_at":"2026-05-28T21:31:14.350Z","repository":{"id":230265226,"uuid":"778909389","full_name":"DenisGas/PS_Profile","owner":"DenisGas","description":"My collection of alias and functions for PowerShell","archived":false,"fork":false,"pushed_at":"2026-01-28T18:46:57.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-29T09:11:45.125Z","etag":null,"topics":["aliases","beautiful","powershell"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DenisGas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-28T16:42:23.000Z","updated_at":"2026-01-28T18:47:23.000Z","dependencies_parsed_at":"2025-01-16T04:15:59.330Z","dependency_job_id":"3500602a-74ae-471e-b255-5691d683602e","html_url":"https://github.com/DenisGas/PS_Profile","commit_stats":null,"previous_names":["denisgas/ps_profile"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DenisGas/PS_Profile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisGas%2FPS_Profile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisGas%2FPS_Profile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisGas%2FPS_Profile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisGas%2FPS_Profile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DenisGas","download_url":"https://codeload.github.com/DenisGas/PS_Profile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisGas%2FPS_Profile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33627934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliases","beautiful","powershell"],"created_at":"2024-11-15T16:15:23.666Z","updated_at":"2026-05-28T21:31:14.343Z","avatar_url":"https://github.com/DenisGas.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# PS_Profile\nMy collection of alias and functions for PowerShell\n\n## Beautiful terminal\n\n![image](https://github.com/DenisGas/PS_Profile/assets/81939899/edad5c5e-3d80-4d2e-9ae4-de8c7d2209a0)\n\n### Links\n\n[windows terminal](https://apps.microsoft.com/detail/9n0dx20hk701)\n\n[folder icons](https://github.com/devblackops/Terminal-Icons)\n\n#### Prompt theme engine for shell.\n\n[ohmyposh](https://ohmyposh.dev/docs/installation/windows)\n\nOR\n\n[starship](https://starship.rs/guide/#%F0%9F%9A%80-installation)\n\n#### Font\nI use [firacode](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/FiraCode.zip) \n\nother options [nerdfonts](https://www.nerdfonts.com/font-downloads)\n## How use \n\nYou need copy functions in you $PROFILE \n\n\n## \"mls\" compact analog comand \"ls\" \n\n### Function\n\n```powershell\n\u003c#\n.SYNOPSIS\nDisplays items in a directory using different filters.\n\n.DESCRIPTION\nThe mls_alias function displays files and directories in the specified path. It can filter the output to show only files, only directories, or all items including hidden ones.\n\n.PARAMETER Path\nSpecifies the path to list the items from. If not provided, it defaults to the current directory.\n\n.PARAMETER All\nShows all items, including hidden files and directories, in a single column.\n\n.PARAMETER Files\nShows only files in the specified directory.\n\n.PARAMETER Directories\nShows only directories in the specified directory.\n\n.PARAMETER Help\nDisplays this help information.\n\n.EXAMPLE\nmls_alias -All\nShows all items, including hidden ones, in the current directory, displayed in a single column.\n\n.EXAMPLE\nmls_alias -Files\nLists only files in the current directory.\n\n.EXAMPLE\nmls_alias -Directories\nLists only directories in the current directory.\n\n.EXAMPLE\nmls_alias -Path 'C:\\Users'\nLists all items in the 'C:\\Users' directory.\n#\u003e\nfunction mls_alias {\n  [CmdletBinding()]\n  param (\n      [string]$Path = \".\",\n      [switch]$All,\n      [switch]$Files,\n      [switch]$Directories,\n      [switch]$Help\n  )\n\n  if ($Help) {\n      # The Get-Help command can automatically display the help comments above.\n      Get-Help $MyInvocation.MyCommand.Name\n      return\n  }\n\n  try {\n      if ($All) {\n          Get-ChildItem $Path -Force | Format-Wide -Column 1\n      } elseif ($Files) {\n          Get-ChildItem $Path -File | Format-Wide\n      } elseif ($Directories) {\n          Get-ChildItem $Path -Directory | Format-Wide\n      } else {\n          Get-ChildItem $Path | Format-Wide\n      }\n  } catch {\n      Write-Host \"Error: $($_.Exception.Message)\"\n\n  }\n}\n\nSet-Alias -Name mls -Value mls_alias -Option AllScope;\n```\n\n### How use comand\n\n`ls` command\n\n![image](https://github.com/DenisGas/PS_Profile/assets/81939899/91982f1a-32da-4047-8d4d-75a0467fb180)\n\n`mls` command\n\n![image](https://github.com/DenisGas/PS_Profile/assets/81939899/d79038dc-3d3b-42b9-91fd-9d78082c82f2)\n\nDisplay all items (files and folders) in the current directory:\n\n```powershell\nmls_alias\n```\n\nOR simply:\n\n```powershell\nmls_alias .\n```\n\nDisplay all items (including hidden items) in the current directory as a single column:\n\n```powershell\nmls_alias -All\n```\n\nDisplay only the files in the current directory:\n\n```powershell\nmls_alias -Files\n```\n\nDisplay only folders in the current directory:\n\n```powershell\nmls_alias -Directories\n```\n\nDisplay a help message:\n\n```powershell\nmls_alias -Help\n```\n\nOpen the Documents directory and display all its contents:\n\n```powershell\nmls_alias \"C:\\Users\\User\\Documents\".\n```\n\n\n\n\n## Analog VScode comand \"code\" for Visual Studio\n\n### Function\n\n```powershell\n\n\u003c#\n.SYNOPSIS\nOpens Visual Studio at the specified directory. If -Solution is specified, it opens the first solution file (.sln) found within the directory.\n\n.DESCRIPTION\nOpens Visual Studio at the specified directory. If -Solution is specified, it searches for and opens the first .sln file found in the directory or its subdirectories.\n\n.PARAMETER Solution\nOpens the solution file (.sln) found in the specified directory.\n\n.PARAMETER Help\nDisplays this help message.\n\n.PARAMETER Directory\nSpecifies the directory to use. Defaults to the current directory.\n\n.EXAMPLE\nVSOpen -Solution\nOpens the first solution file in the current directory.\n\n.EXAMPLE\nVSOpen -Directory 'C:\\Projects\\MyProject'\nOpens Visual Studio at the specified directory.\n\n.EXAMPLE\nVSOpen -Solution -Directory 'C:\\Projects\\MyProject'\nOpens the first solution file found in 'C:\\Projects\\MyProject'.\n#\u003e\nfunction VSOpen {\n  [CmdletBinding()]\n  param(\n    [switch]$Solution,\n    [switch]$Help,\n    [string]$Directory = $PWD.Path\n  )\n\n  if ($Help) {\n    Get-Help $MyInvocation.MyCommand.Name\n    return\n  }\n\n  try {\n    # Process if -Solution switch is used\n    if ($Solution) {\n      $solutionFile = Get-ChildItem -Path $Directory -Filter *.sln -Recurse -File | Select-Object -First 1\n\n      if ($solutionFile) {\n        Write-Output \"Solution file found: $($solutionFile.FullName)\"\n        Start-Process devenv.exe $solutionFile.FullName\n      }\n      else {\n        Write-Output \"Solution file not found in the specified directory and its subdirectories.\"\n      }\n    }\n    else {\n      # Opens Visual Studio in the specified directory if no solution file is needed\n      Start-Process devenv.exe $Directory\n    }\n  }\n  catch {\n    Write-Error \"An error occurred: $_\"\n  }\n  finally {\n    # Ensure to return to the original directory (not necessarily needed unless further commands rely on it)\n    Set-Location $originalDirectory\n  }\n}\n\nSet-Alias -Name vs -Value VSOpen -Option AllScope\n\n\n\n```\n\n### How use comand\n\n#### Open the Current Directory in Visual Studio\n\nYou can open the current directory directly in Visual Studio using either of the following commands:\n\n```powershell\nvs .\n```\n\nOR\n\n```powershell\nvs\n```\n\nBoth commands will launch Visual Studio with the current directory loaded.\n\n#### Open the First Solution Found (.sln) in the Current Directory and Its Subdirectories\n\nTo open the first `.sln` file that is found in the current directory and its subdirectories, use:\n\n```powershell\nvs -Solution\n```\n\nThis command searches for the first solution file in the current and all nested directories, and opens it in Visual Studio.\n\n#### Show Help Message\n\nIf you need assistance or want to see the usage information for the `VSOpen` function, type:\n\n```powershell\nvs -Help\n```\n\nThis command displays help information about how to use the `VSOpen` command, detailing all available parameters.\n\n#### Open a Specific Directory in Visual Studio\n\nTo open a specific directory in Visual Studio, such as the \"repos\" directory located at `C:\\Users\\user\\repos`, use the command:\n\n```powershell\nvs -Directory \"C:\\Users\\user\\repos\"\n```\n\nThis command launches Visual Studio and loads the specified directory.\n\n## Run repos npm/pnpm script\n\n### !!!IMPORTANT!!! need fzf\n\n```powershell\nwinget install junegunn.fzf\n```\n\n### How use comand\n\nnpm comand\n```powershell\nnps\n```\n\nOR \n\npnpm comand\n```powershell\npnps\n```\n\npreview\n\u003cimg width=\"1072\" height=\"494\" alt=\"image\" src=\"https://github.com/user-attachments/assets/baa65ada-32f3-4a14-af4e-81477fbf7dec\" /\u003e\n\n\n\n\n\n```powershell\nfunction Select-PackageScript {\n    param (\n        [Parameter(Mandatory)]\n        [ValidateSet(\"npm\", \"pnpm\")]\n        [string]$Runner\n    )\n\n    $packagePath = Join-Path (Get-Location) \"package.json\"\n\n    if (-not (Test-Path $packagePath)) {\n        Write-Host \"package.json не знайдено\" -ForegroundColor Red\n        return\n    }\n\n    $json = Get-Content $packagePath -Raw | ConvertFrom-Json\n\n    if (-not $json.scripts) {\n        Write-Host \"scripts відсутні\" -ForegroundColor Yellow\n        return\n    }\n\n    $script = $json.scripts.PSObject.Properties.Name |\n        fzf --prompt=\"$Runner run \u003e \" --height=40% --reverse\n\n    if ($script) {\n        Write-Host \"▶ $Runner run $script\" -ForegroundColor Green\n        \u0026 $Runner run $script\n    }\n}\nfunction npm-scripts {\n    Select-PackageScript -Runner \"npm\"\n}\nfunction pnpm-scripts {\n    Select-PackageScript -Runner \"pnpm\"\n}\n\nSet-Alias -Name nps -Value npm-scripts -Option AllScope;\nSet-Alias -Name pnps -Value pnpm-scripts -Option AllScope;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisgas%2Fps_profile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenisgas%2Fps_profile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisgas%2Fps_profile/lists"}