Skip to content

Lab10Powershell

echadbourne edited this page Nov 3, 2023 · 4 revisions

Aliases

In Powershell you can set aliases which run certain commands as if you had typed their true name. You can do this like so:

Set-Alias -Name ifconfig -value ipconfig

  • This only works for the session you are currently in. If you want this is be persistent you will need to research Powershell Profiles

You can also search for the definitions of an alias like dir like so:

alias dir - this will output what dir points to, which in this case is Get-ChildItem (this is what will actually run)

Scripts

Scripts in powershell are called .ps1 and work very similarly to bash scrips, with slightly different syntax. In order to run scripts you will need to run the following command:

  • Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

Clone this wiki locally