Creating "CmdLet of the Day" in Powershell

Hi Friends,

Today we are going to learn how to use Powershell to generate random command lets and learn them with examples. So in simple terms what we are going to do is we will write a powershell script which will generate random commands available in powershell and display all its description and finally the output will be generated in a text file. I think its getting complicated so lets start step by step.
Follow the Steps below as directed :

Step 1 : Open Run( Windows + R ) -> Type "Powershell ise" without quotes -> Powershell ISE window will open and copy-paste the below Scripts and Save as "<script_name>.ps1"

Step 2 : In order to run the Script we can either go to that location where script is kept in powershell and run ".\<script_name>.ps1" or can run through creating a simple batch file(Open Notepad -> Copy-Paste the below code -> save with ".bat" extension and Double click on the file). 

@echo off
Powershell.exe -command "& 'C:\Script.ps1'"

That's it done.
Credits : Prateek

Do visit his website Geekeefy for more interesting stuffs like this !

For more reference watch the video Below.

Copyright © 2016 Amar Helloween. Powered by Blogger.