wuping2004 / doc

1 stars 0 forks source link

Powershell Geek #10

Open wuping2004 opened 3 years ago

wuping2004 commented 3 years ago

Overview

It can save time and effort for frequently operation. How powerful it is, it depends on defined customized function.  

Get Started Below is how to setup and access a world time link which is frequently used: a world time link: https://www.worldtimebuddy.com/

  1. Open power shell, and run Set-ExecutionPolicy RemoteSigned run powershell command, run Test-Path $Profile ,  it is checking if power shell profile exists.

If result is true, just open the power shell profile under below path C:\Users\\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

  1. If result is false, run below command  to create power shell profile. New-Item –Path $Profile –Type File –Force notepad $Profile

  2. Add some functions in this file

function worldtime { start-process -filepath "https://www.worldtimebuddy.com/" }

function setting { start-process -filepath " C:\Users\\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" } 4. Restart the powershell, then the function will be available for usage in powershell.