This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Inspired by this post (https://www.linkedin.com/posts/adambertram_powershell-activity-7197241312096501762-nj87), I got curious and | |
wanted to test the efficiency of each filters and advanced functions. | |
I remembered reading about them in a book years ago, advanced functions providing a better approach. | |
Here I got curious and wanted to give it a test. | |
Results for 3 100x runs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$helpTopic = "about_Splatting" | |
$excludedWords = "the" | |
$words = ((Get-Help $helpTopic) -replace "[^\w]"," " -replace "\d"," " -replace '_'," " -split " ") | Where-Object {$_ -ne ""} | |
$sortedWords = $words | Group-Object | Sort-Object -Property Count -Descending | Where-Object -Property Name -NE $excludedWords | |
[PSCustomObject]@{ | |
'Help Topic Name' = $helpTopic | |
'Word Count' = $words.Count | |
'Top Word' = ($sortedWords | Select-Object -First 1).Name | |
'Top Word Count' = ($sortedWords | Select-Object -First 1).Count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Replace-LineInText { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Position=0)] | |
[string]$fileDirectory, | |
[Parameter(Position=1)] | |
[string]$fileExtension, | |
[Parameter(Position=2)] | |
[int]$lineNumber, | |
[Parameter(Position=3)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az account list-locations | ConvertFrom-Json | FT displayName,name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
$Name = 'WEB1', | |
$Location = 'westeurope', | |
$ResourceGroup = 'WebServers' | |
) | |
New-AzResourceGroup -Name $ResourceGroup -Location $Location | |
$params = @{ | |
Name = $Name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html dir="ltr" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" gpmc_reportInitialized="false"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-16" /> | |
<title>Windows 10 Security Settings</title> | |
<!-- Styles --> | |
<style type="text/css"> | |
body { background-color:#FFFFFF; border:1px solid #666666; color:#000000; font-size:68%; font-family:MS Shell Dlg; margin:0,0,10px,0; word-break:normal; word-wrap:break-word; } | |
table { font-size:100%; table-layout:fixed; width:100%; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
lockPref("network.proxy.type", 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pref("general.config.obscure_value", 0); // only needed if you do not want to obscure the content with ROT-13 | |
pref("general.config.filename", "mozilla.cfg"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.facebook.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PUT IN ALPHABETICAL ORDER | |
.aadrm.com | |
.activedirectory.windowsazure.com | |
.adhybridhealth.azure.com | |
.ajax.aspnetcdn.com | |
.ajax.googleapis.com | |
# .amazon.com | |
# .amazonaws.com | |
.appex.bing.com | |
.appex-rf.msn.com |
NewerOlder