Friday, October 26, 2018

How do you use cmdlet Add-Content in Windows PowerShell?

You can do a lot of  things with Add-Content.

These are all the parameters you can use with Add-Content.

Add-Content
   [-Value]
   [-PassThru]
   [-Path]
   [-Filter ]
   [-Include ]
   [-Exclude ]
   [-Force]
   [-Credential ]
   [-WhatIf]
   [-Confirm]
   [-UseTransaction]
   [-NoNewline]
   [-Encoding ]
   [-Stream ]
   []


The following example demonstrates on of them using the -Path parameter.

Now create two (or more) empty files in an allowed folder:
I created two text files (empty) and saved them to a folder:

C:\Users\Jayaram\Documents\Jay_1.txt
C:\Users\Jayaram\Documents\Jay_2.txt


Now using Add-Content, I will add current date to the end of these files. These being empty, the dates will added to the top of the files.

Now launch the Windows PowerShell ISE and run this code:


Now go check the files and you should see the dates added.




What kind of an application is RUFUS?



RUFUS is an app with a small size that helps formatting USB flash and also to create a bootable drive from a flash.

You can download rufus-3.3.exe (1.1 M) from here:
https://rufus.ie/downloads/

I don't get this, do you?

I am using Google Chrome. Why I am served this page?

Monday, October 22, 2018

How do you display Commands pane in Windows PowerShell?

You often want to look at all commands available shown in the commands pane.
By default it may not be shown when you launch PowerShell and perhaps this is what you see.


PS_CommandsPane_0


You can display the command pane using the View menu as shown.


PS_CommandsPane_1


Click Show Command Add-on. Now the command pane is added as shown.


PS_CommandsPane_2


You can also use the Object Model code to display the Command pane as shown.


PS_CommandsPane_3

Sunday, October 21, 2018

Can you modify the Windows PowerShell ISE User Interface?

The short answer is 'Yes'.

Windows PowerShell ISE has a Scripting Object Mdel which is hierarchical. The root object is: $psISE object which is an instance of Microsoft.PowerSehll.Host.ISE.ObjectModelRoot class.

Under the 'root' there are many other objects such as; CurrentFile, CurrentPowerShellTab etc.


Here are some $psISE properties:


ISE_0


ISE_1


ISE_2


ISE_3

From the 'root. object I can create a new tab in the Windows PowerShell ISE with a name to display it as shown.

You can create a new tab 'Test' using this code. A new tab 'Test' is added to the UI as shown.:


ISE_04

Saturday, October 20, 2018

What verb-noun pairs are available in PowerShell?

In PowerShell, verb-name pair refers to naming of Cmdlets.

Here is an example:
---------------
Verb-Noun
Get-Command

---------------

Get is the verb and Command is the noun. This cmdlet retrieves all commands registered in PowerShell

PowerShell has an extensive set of Cmdlets to cover various aspects of Management.
These are the principle high-level verbs.

Common Verbs
  
System.Management.Automation.VerbsCommon enumeration class to define generic actions that can apply to almost any cmdlet.

Communication Verbs
System.Management.Automation.VerbsCommunications class to define actions that apply to communications.

Data Verbs
System.Management.Automation.VerbsData class to define actions that apply to data handling.

Diagnostic Verbs
System.Management.Automation.VerbsDiagnostic class to define actions that apply to diagnostics

Lifecycle Verbs
System.Management.Automation.VerbsLifeCycle class to define actions that apply to the lifecycle of a resource

Security Verbs

System.Management.Automation.VerbsSecurity class to define actions that apply to security.

Other Verbs
System.Management.Automation.VerbsOther class to define canonical verb names that do not fit into a specific verb name category such as the common, communications, data, lifecycle, or security verb names verbs.

Read more here:
https://docs.microsoft.com/en-us/powershell/developer/cmdlet/approved-verbs-for-windows-powershell-commands

Wednesday, October 17, 2018

What is SIPC?

If you are investing in 401(k), IRA, Roth IRA etc., you better be advised of what SIPC stands for otherwise you may be in for surprises.

 This is how SIPC is defined by the U.S. Securities and Exchange Commission:

"If your brokerage firm goes out of business and is a member of the Securities Investor Protection Corporation (SIPC), then your cash and securities held by the brokerage firm may be protected up to $500,000, including a $250,000 limit for cash. When a SIPC member becomes insolvent, SIPC will ask a court to appoint a trustee to supervise the firm's liquidation and to process investors' claims.
SIPC covers most types of securities, such as stocks, bonds, and mutual funds. But SIPC does not protect you against losses caused by a decline in the market value of your securities. And it does not provide protection for investment contracts not registered with the SEC.
"
Make sure your investment is in a provider who is a SIPC member. If you are investing your money in a on-SIPC member you need to be extra careful.

In any case your read to end the following link if you don't want to be one involved in a scam as in American Greed.

https://www.sec.gov/fast-answers/answerssipchtm.html