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

Monday, October 15, 2018

Do US Citizens need visa to visit United Arab Emirates as a tourist?

According to the site shown below, you may get a visa on arrival. The same rule for several other countries as well.


Sunday, October 14, 2018

How do you install the latest SQL Operations Studio?

I was using SQL Operations Studio (SQLOPS) Ver 0.26.7 and I am upgrading to the July 2018 Public Preview version 0.31.4.

It is Available on Windows, macOS and Linux and you can download from here:
https://docs.microsoft.com/en-us/sql/sql-operations-studio/download?view=sql-server-2017


Installation procedute for all the OS's available on the above site.

This is the file for Windows OS:
sqlops-windows-setup-0.31.4.exe (74.3 MB)

Double click the executable to launch the application.
Here are the installation screen shots.


Accept license terms.






 The program is added to the PATH and you can launch soon after installing.





I connected to the SQL Server 2016 named instance after launching.


In the Preview you can see a number extensions that you will be able to access.







Tuesday, October 2, 2018

How do you convert a PNG file to a PDF file?

Some sites do not accept image files and they suggest a PDF format as acceptable.

There are more ways than one to do this.

1. There is an online tool here that you can use:

https://png2pdf.com/

While using this site, do not simply click the big green buttons but use this image as guid. Click Upload and Download buttons.



2. You can use Adobe Acrobat to Convert your Image. You can use the free trial of Acrobat

3. I just paste the image in a Word [Version 1808 Build 10730.20127document and save the Word document with a .pdf extension. You can paste multiple images + any text you like and create a single PDF.