Are you over 18 and want to see adult content?
More Annotations
A complete backup of czechgaysolarium.com
Are you over 18 and want to see adult content?
A complete backup of zapinterlations.com
Are you over 18 and want to see adult content?
A complete backup of bigoliveapkmod.com
Are you over 18 and want to see adult content?
A complete backup of queenletiziastyle.com
Are you over 18 and want to see adult content?
A complete backup of smashingpumpkins.com
Are you over 18 and want to see adult content?
A complete backup of biologyjunction.com
Are you over 18 and want to see adult content?
Favourite Annotations
A complete backup of cmoncleroutlett.com
Are you over 18 and want to see adult content?
A complete backup of devenir-aviateur.fr
Are you over 18 and want to see adult content?
A complete backup of designstuff.com.au
Are you over 18 and want to see adult content?
A complete backup of poloralph-laurenuk.co.uk
Are you over 18 and want to see adult content?
Text
CONVERTTO-DATATABLE
I have used Chad Millers (@cmille19) Out-DataTable function on numerous occasions. It is used to convert a regular PowerShell object to a DataTable object. It had it quirks though, so I decided to rewrite it to try to fix some of them. Most notably I have changed itso, in
HOW TO RELOAD THE POWERSHELL CONSOLE SESSION During lunch with a colleague we started talking about how it would be really nice to be able to reload the current PowerShell session when working in the console. For those of us using the brilliant ISESteroids, this functionality have been available for ISE users for a little while now. I QUICK TIP: ACCESSING THE CONTROL PANEL FROM POWERSHELL I haven't seen many people use this, but it's quite simple to access items in the Control Panel directly from PowerShell, using the Get-ControlPanelItem and Show-ControlPanelItem cmdlets. Use Get-ControlPanelItem to list all items in the Control Panel: Or use wildcards to search for specific items: When you have found the itemyou want to open,
RETRIEVE SSL CERTIFICATE INFORMATION I recently had a need to retrieve SSL certificate information from a group of servers, running a mix of both Linux and Windows, and I didn't really want to get the information manually. The web applications running on these servers where a mix of "regular" web applications and applications without any front-end. Also many of PROGRESS BAR AND SECONDS REMAINING Progress Bar and Seconds Remaining. In my last post about using progress bars in PowerShell, we went through the basic usage, as well as nesting of progress bars. There was however one parameter that I didn’t discuss, and that I seldom see used; the SecondsRemaining parameter. As the name implies, this parameter lets you give feedbackon the
USING CUSTOM FUNCTIONS AND TYPES IN POWERSHELL QUICK TIP: DYNAMICALLY CREATE AND USE VARIABLES But in this quick tip I will show you how to create and use variables dynamically, and then they come in handy indeed. Consider the following code: We have an array of prefixes that we want to use to prefix some variables that we will be using in our script. Our variables should be named ‘ p1_var ‘, ‘ p2_var ‘ and so on. QUICK TIP: ENUMS WITH FLAGSATTRIBUTE If you have worked with PowerShell for a while, chances are you are familiar with Enums. If you have also worked with more traditional programming languages you definitely are familiar with Enums! Enums can have custom attributes, and one such attribute is the topic this quick tip; the FlagsAttribute! This custom attribute is used to FILTERING DATA ON DATE IN POWERSHELL When working with large data sets, being able to effectively filter the data is essential. A common exercise where you might need filtering on date is when reading logs, and in this blog post I will show you how you can perform the typical “get all logs from the last x days” and “get all logs between day x and day y” scenarios. I’ll be using the Get-WinEvent cmdlet in the following ENCODE/DECODE BASE64URL Luckily, translating from c# to PowerShell isn’t that hard, so I thought I’d share the functions I wrote (translated) with you. NOTE! I take no credit for these functions, other than the fact I translated them from c#. The full credit goes to Jonathan Taylor. These functions lets you decode and encode to and from Base64 Url. DEFAULT { WriteCONVERTTO-DATATABLE
I have used Chad Millers (@cmille19) Out-DataTable function on numerous occasions. It is used to convert a regular PowerShell object to a DataTable object. It had it quirks though, so I decided to rewrite it to try to fix some of them. Most notably I have changed itso, in
HOW TO RELOAD THE POWERSHELL CONSOLE SESSION During lunch with a colleague we started talking about how it would be really nice to be able to reload the current PowerShell session when working in the console. For those of us using the brilliant ISESteroids, this functionality have been available for ISE users for a little while now. I QUICK TIP: ACCESSING THE CONTROL PANEL FROM POWERSHELL I haven't seen many people use this, but it's quite simple to access items in the Control Panel directly from PowerShell, using the Get-ControlPanelItem and Show-ControlPanelItem cmdlets. Use Get-ControlPanelItem to list all items in the Control Panel: Or use wildcards to search for specific items: When you have found the itemyou want to open,
RETRIEVE SSL CERTIFICATE INFORMATION I recently had a need to retrieve SSL certificate information from a group of servers, running a mix of both Linux and Windows, and I didn't really want to get the information manually. The web applications running on these servers where a mix of "regular" web applications and applications without any front-end. Also many of PROGRESS BAR AND SECONDS REMAINING Progress Bar and Seconds Remaining. In my last post about using progress bars in PowerShell, we went through the basic usage, as well as nesting of progress bars. There was however one parameter that I didn’t discuss, and that I seldom see used; the SecondsRemaining parameter. As the name implies, this parameter lets you give feedbackon the
QUICK TIP: EASY ACCESS TO SPECIAL SYMBOLS In this quick tip, I'm going to show you a way to organize and quickly access special symbols in PowerShell. You might know that you can access a characters ASCII value by the following command By using this command we are getting the ASCII value of the '%' character. But there are more ASCII characters,POWERSHELL PRIME
Prime numbers will always have a special place in every mathematicians (or cryptographers) heart. The usefulness for the standard PowerShell user is questionable, but just for the fun of it I have created/translated a couple of functions for working with Primes. The first function is called Get-PrimeNumbers and will, as the name suggests, output the first ENCODE/DECODE BASE64URL Luckily, translating from c# to PowerShell isn’t that hard, so I thought I’d share the functions I wrote (translated) with you. NOTE! I take no credit for these functions, other than the fact I translated them from c#. The full credit goes to Jonathan Taylor. These functions lets you decode and encode to and from Base64 Url. DEFAULT { Write HOW TO RELOAD THE POWERSHELL CONSOLE SESSION During lunch with a colleague we started talking about how it would be really nice to be able to reload the current PowerShell session when working in the console. For those of us using the brilliant ISESteroids, this functionality have been available for ISE users for a little while now. I PROGRESS BAR AND SECONDS REMAINING In my last post about using progress bars in PowerShell, we went through the basic usage, as well as nesting of progress bars. There was however one parameter that I didn’t discuss, and that I seldom see used; the SecondsRemaining parameter.. As the name implies, this parameter lets you give feedback on the seconds remaining of the total task when using the Write-Progress cmdlet. QUICK TIP: ENUM WITH STRING VALUES Quick tip: Enum with string values. Using enums can come in handy in many situations. When writing an advanced function in PowerShell, using an enum as the parameter type will ensure that only valid values are used, as well as give you tab-complete functionality (The same can be achieved using ValidateSet). Now, I was working on extending my QUICK TIP: FIX THOSE LINE ENDINGS In dealing with data transferred between different operating systems, we often come across the irritating phenomenon of, what might appear as, a file without any spaces in them. This is of course because of different end of line (EOL) characters, and I'm going to show you a quick and easy way of using PowerShell to RETRIEVE SSL CERTIFICATE INFORMATION I recently had a need to retrieve SSL certificate information from a group of servers, running a mix of both Linux and Windows, and I didn't really want to get the information manually. The web applications running on these servers where a mix of "regular" web applications and applications without any front-end. Also many of QUICK TIP: TRIM NULL-TERMINATED STRINGS Recently, when reading string data from a binary file, I stumbled across the "problem" of trimming the terminating character from a null-terminated string. I started getting all creative about it, but it soon became quite a mess (code-wise), so I that down and had a CALCULATE CRC32 IN POWERSHELL This will give you the CRC32 checksum of 2730794414, which is an INT64. If you want to convert it to HEX, you can do the following: ::ToString (2730794414,16) This will give you the HEX value of a2c49dae. The function takes a byte array as input, which is the reason I had to convert the string in the example above.Skip to content
Menu Home
* Github
* Google+
Close
COMMUNARY
Search for:
* Home
* PowerShell Expand childmenu
* Custom Functions
* Quick tips
* About
* Home
* PowerShell
* Custom Functions
* Quick tips
* About
TOP POSTS & PAGES
* Grep, the PowerShell way * Quick tip: Dynamically create and use variables * Calculate CRC32 in PowerShell * Download NuGet packages from PowerShell * Quick tip: ConvertTo-Json and line breaks in strings * How to reload the PowerShell console session * Filtering data on date in PowerShell * How to add a progress bar to your PowerShell script * Getting git to work through a proxy server (in Windows) * Using custom Functions and Types in PowerShell RunspacesBLOGS I FOLLOW
* Richard DBA
* IT Pro PowerShell experience * A Power Knight's journey * Xenoprimate's Dev Blog* Mike F Robbins
* pshirwin
* blog.kilasuit.org
* Tech, Automation, Life * Jaap Brasser's Blog* psjjw
* PowerShellize
* >_
* Don Jones®
* Learn Powershell | Achieve More * ConfigurationMgrDistrict* Rohn's Blog
* Tech thoughts
* Salisbury and Stonehenge * powershelldistrict.com/* Dave Wyatt's Blog
ARCHIVES
* May 2018 (1)
* March 2018 (2)
* February 2018 (3)* August 2017 (2)
* May 2017 (1)
* April 2017 (3)
* February 2017 (1) * January 2017 (3) * October 2016 (2) * September 2016 (4)* August 2016 (1)
* July 2016 (1)
* May 2016 (2)
* April 2016 (4)
* February 2016 (8) * January 2016 (6) * December 2015 (2) * November 2015 (4) * October 2015 (2) * September 2015 (3)* May 2015 (8)
* April 2015 (10)
* February 2015 (5) * January 2015 (7) * December 2014 (12) * November 2014 (14) * October 2014 (21) * October 2012 (9) QUICK TIP: INVOKE-WEBREQUEST AND SSL/TLS Posted on May 14, 2018September 24, 2018 by Øyvind Kallstad inPowerShell
If you have ever tried using Invoke-WebRequest to get a webpage using SSL, you will most likely have seen the following error message: > _Invoke-WebRequest : The request was aborted: Could not create > SSL/TLS secure channel._ The simple “fix” for this problem is to tell PowerShell to use TLS 1.2 instead of the default 1.0:1
2
::SecurityProtocol =::Tls12
Invoke-WebRequest -Uri "https://some.site.com" QUICK TIP: CONVERTTO-JSON AND LINE BREAKS IN STRINGS Posted on March 30, 2018 by Øyvind Kallstad inPowerShell
The built-in commands to convert to and from JSON is some (of many) great reasons why PowerShell is such a joy to use. In this short blog post I’m going to write about using line breaks in strings together with CONVERTTO-JSON. (more…) FILTERING DATA ON DATE IN POWERSHELL Posted on March 11, 2018 by Øyvind Kallstad inPowerShell
When working with large data sets, being able to effectively filter the data is essential. A common exercise where you might need filtering on date is when reading logs, and in this blog post I will show you how you can perform the typical “_get all logs from the last x days_” and “_get all logs between day x and day y_” scenarios. (more…) POWERSHELL 6 AND ‘LS’ Posted on February 16, 2018February 16, 2018by Øyvind
Kallstad in PowerShell I’m one of those that always preferred to use the alias ls instead of dir for _Get-ChildItem_. In the beginning I mixed them up, but when I started using Linux more and more I liked that I could use the same command for the same thing in both PowerShell and bash. Enter PowerShell 6, available to run on Linux and suddenly ls is not the same as ls anymore! (more…) CONVERTTO-SHORTENEDPATH Posted on February 4, 2018February 4, 2018by Øyvind
Kallstad in PowerShell If you have ever customized your PowerShell prompt you have probably had a need (or wish) for a function to “intelligently” shortening the current path. I have written a bunch of functions for this and decided to expand on my earlier versions and release it to the PowerShell Gallery. (more…) DOWNLOAD NUGET PACKAGES FROM POWERSHELL Posted on February 2, 2018 by Øyvind Kallstad inPowerShell
Most of you have probably used the _PowerShell Package Management_ cmdlets to download modules from the PowerShell Gallery . Some may even have used it to download software from Chocolatey . In this blog post I’m going to show you how to configure it to be able to download packages from NuGet . (more…) RETRIEVE SSL CERTIFICATE INFORMATION Posted on August 16, 2017August 16, 2017 by Øyvind Kallstad inLinux , PowerShell
I recently had a need to retrieve SSL certificate information from a group of servers, running a mix of both Linux and Windows, and I didn’t really want to get the information manually.(more…)
AUTHENTICATING TO AZURE IN A RELEASE PIPELINE Posted on August 10, 2017August 10, 2017 by Øyvind Kallstad inDevOps , PowerShell
When doing automated deployments to Azure, I found that I was missing a single approach for authentication when used both in a release pipeline, and when doing ad hoc testing during development. I needed something that let me use an Azure Service Principal for automated processes, as well as using my private credentials for otherusages.
After many iterations, I think I have something that is worthwhile sharing with others, in the form of simple templates that gives you a kick-start to any Azure project! (more…)UPDATE-AZURERMTAG
Posted on May 10, 2017by Øyvind
Kallstad in PowerShell I recently had a need of tagging a large number of resources in Azure, and found it difficult to do this easily. So naturally I ended up creating a helper function to do the job for me. (more…) AWS EC2: MONITORING MEMORY IN CLOUDWATCH Posted on April 22, 2017 by Øyvind Kallstad in AWS Monitoring AWS infrastructure using CloudWatch is mostly a case of just enabling it for the resources you want monitored. You get automatically selected metrics available in CloudWatch, ready for your dashboard. For some reason though, for EC2 instances you do not get any memory (or disk) metrics. I guess this is a shortcoming Amazon have been asked about a lot, because they have made scripts available that you can run on the instance that will send memory and disk data to CloudWatch. (more…)POSTS NAVIGATION
Older
Older posts
Blog at WordPress.com.Richard DBA
RichardImenes.com
IT Pro PowerShell experience Share what I know or discovered when working with Windows PowerShell. A Power Knight's journey Xenoprimate's Dev Blog C#, Game Design, Performant Programming, .NET, Vulkan, MultithreadingMike F Robbins
Scripting | Automation | Efficiencypshirwin
Spreading the gospel of powershell scriptingblog.kilasuit.org
An insight into my workings and inner most thoughts.Mainly PowerShell but some other tech and non-tech too Tech, Automation, LifeFlynn Bundy
Jaap Brasser's Blog
Technology, Cloud computing and Automation...psjjw
Een opbergkast meer nietPowerShellize
Automate, Accelerate, Accurate>_
de parvis grandis acervus eritDon Jones®
Tech | Career | Musings Learn Powershell | Achieve More What is this Powershell of which you speak? ConfigurationMgrDistrict Passionate people that gather together, and create awesome things!Rohn's Blog
Just Another PowerShell BlogTech thoughts
up in the trees
Salisbury and Stonehenge powershelldistrict.com/Dave Wyatt's Blog
Post to
Cancel
* Follow
*
* Communary
* Customize
* Follow
* Sign up
* Log in
* Report this content * Manage subscriptions* Collapse this bar
Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0