Home Powershell
Post
Cancel

Powershell

updated at 2024-02-02 17:50

Permanent Alias

check

1
2
3
echo $profile
# kalo belum ada bikin dulu
# New-Item -Path $PROFILE -Type File -Force

edit in code

1
code $profile

copas saja dulu

1
2
3
4
5
6
7
8
9
10
11
12
13
Set-Alias np notepad.exe

function emu-list {emulator -list-avds}
Set-Alias -Name emu -Value emu-list

function emu-1 {emulator -avd Pixel_4_API_30 }
Set-Alias -Name em1 -Value emu-1

Function Goto-Projects { Set-Location -Path c:\Users\rendr\Projects }
Set-Alias -Name cdp -Value Goto-Projects

Function Goto-Www { Set-Location -Path C:\laragon\www }
Set-Alias -Name www -Value Goto-Www

isError??

Jika ada error seperti ini:

Run Powershell as Admin

Check Policy

1
2
Get-ExecutionPolicy
Get-ExecutionPolicy -List

Set Policy local

1
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

Test Alias

Install Oh My Post

https://ohmyposh.dev/docs/

Desktop View “oh my posh contoh”

Useful Command

commandDescriptions
Get-ComputerInfoInformasi PC
Get-ComputerInfo -Property “*version” 
Get-ComputerInfo -Property “*Arch*” 
systeminfo | find “System Type” 
(Get-Command notepad).Source 
Get-ServiceGet All Services
Get-Service *lan* 
Get-Service Lanman 
Get-Service -Name LanmanWorkstation -RequiredServices 
Get-Service -Name LanmanServer -RequiredServices 

Desktop View Get-Service

Services

Get-Service *sql*
Stop-Service MSSQLSERVER
Start-Service MSSQLSERVER
This post is licensed under CC BY 4.0 by the author.