GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Home
  • PowerShell Modules
  • Russian version of the blog
  • August 4, 2020August 4, 2020
  • Сергей Васин
  • Adding custom types to PowerShell objects
  • Saving a PowerShell command for later use
  • June 17, 2020
  • PowerShell command history
  • ForEach-Object and its scriptblocks
  • May 26, 2020May 26, 2020
  • PSPropertyExpression type
  • Using delegates in PowerShell
  • August 21, 2019

This view

  • Original page
  • New address

GeezerVison is showing inpowershell.wordpress.com — sergey vasin

In this article we will continue exploring content of the SamplePSReadLineProfile.ps1 from the PSReadline module.

In many code editors interaction with brackets – () {} [] – and quotes – "" '' – goes like this – you type the first one and the second one is added automatically, if you then delete the first bracket or quote using the Backspace key, the second one is also deleted. When you finished entering the content, you type the right bracket or quote and the editor doesn’t add another one but just steps over the existing one.

The same we can say about PowerShell console.

Continue reading →

Every PowerShell object is of some data type. For example, the process object is an instance of System.Diagnostics.Process type.

Get-Process | Get-Member
   TypeName: System.Diagnostics.Process
...

Objects that result from PowerShell commands execution belong to some data type, but this doesn’t prevent us from adding a custom type.

It becomes even more useful when we work with custom objects – System.Management.Automation.PSCustomObject.

[PSCustomObject]@{
    Name = 'Object'
    Description = 'Object Description'
}

Continue reading →

Let’s suppose the following. You are working with PowerShell console and just finished typing a long and complex command. This second it occurs to you, that you forgot to define a variable, create a remote session or something else. You delete the command, execute some required actions, and type the command again.

Sounds familiar?

In this article we will talk about some techniques, that can help us out.

Continue reading →

Plaster allows developers to scaffold file and folder structure for a new PowerShell module.

Continue reading →

PowerShell keeps the history of executed commands.

PowerShell itself keeps them in memory. In addition to this, the PSReadline module saves them in a file on the hard drive. that allows us to go back to command entered not only in the current session, but also executed some time ago and probably in different PowerShell version.

Continue reading →

ForEach-Object is used for performing specified actions on every element of an array.

This array can be specified as a value of the -InputObject parameter, but in the majority of cases it is received from the pipeline.

Continue reading →

The -like operator allows us to use wildcards to select required objects.

For example, like this.

Continue reading →

Microsoft.PowerShell.Commands.PSPropertyExpression type (it’s type accelerator – [pspropertyexpression]) exists in PowerShell from the beginning, but in version 6.1 it was made public, what makes it accessible to us, as a script and module authors.

Continue reading →

What is a delegate? This is an object type, that instantiates by associating with some method so that we can invoke this method by calling the delegate.

Why is this needed? One of the cases – is that we can use delegate as a parameter for another method.

Is PowerShell supports this? Starting with version 6.1 – yes.

Continue reading →

In the previous post we discussed SharePoint Online cloud service. Now, let’s talk about SharePoint farm deployed on premises.

We can specify Primary and Secondary site collection administrators in the SharePoint Central Administration portal by clicking on Application Management and then on Change site collection administrators in the Site Collections section.

Primary and secondary administrators are those who, among other things, receive e-mail notifications about various SharePoint event, like when a site collection reaches its storage limit.

Also, you can specify list of other administrators in the Site Settings. To do this, on the site collection click the cog at the upper right part of the page and then click Site Settings. If there is no such a setting in the menu, click on the Site information and then on the View all site settings. Finally, click on the Site collection administrators in the Users and Permissions section.

Now, let’s do it with PowerShell.

Continue reading →

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.