Skip to content

Commit

Permalink
Merge pull request #41 from deadlydog/AddSecurityCategory
Browse files Browse the repository at this point in the history
feat: Add new Security category for tips
  • Loading branch information
deadlydog authored Oct 7, 2023
2 parents 2e66f84 + 1a3a338 commit bd7e0ab
Show file tree
Hide file tree
Showing 25 changed files with 38 additions and 31 deletions.
3 changes: 2 additions & 1 deletion src/CSharpClasses/tiPSClasses/PowerShellTip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public enum TipCategory
Editor, // Editor tips and extensions. e.g. VSCode, ISE, etc.
Module, // Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
NativeCmdlet, // Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
Performance, // Tips to improve performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
Performance, // Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
Security, // Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
Syntax, // Syntax tips. e.g. splatting, pipeline, etc.
Terminal, // Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
Other // Tips that don't fit into any of the other categories.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ $tip.Urls = @(
'https://powershellexplained.com/2018-12-23-Powershell-null-everything-you-wanted-to-know/'
'https://stackoverflow.com/a/60996703/602585'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ $tip.Example = ''
$tip.Urls = @(
'https://woshub.com/powershell-commands-history/'
)
$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ $tip.Example = @'
$tip.Urls = @(
'https://blog.danskingdom.com/PowerShell-intellisense-on-the-command-line/'
)
$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ $tip.Example = @'
$tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ $tip.Urls = @(
'https://powershell.org/series/powershell-community-call/'
'https://www.youtube.com/@powershellanddscteamchanne5739'
)
$tip.Category = [tiPS.TipCategory]::Community # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Community # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ $tip.Urls = @(
'https://www.powershellgallery.com/packages/ImportExcel'
'https://github.com/dfinke/ImportExcel'
)
$tip.Category = [tiPS.TipCategory]::Module # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Module # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-content',
'https://4sysops.com/archives/parse-log-files-with-powershell/'
)
$tip.Category = [tiPS.TipCategory]::NativeCmdlet # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::NativeCmdlet # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ $tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-gridview'
'https://woshub.com/using-out-gridview-table-powershell/'
)
$tip.Category = [tiPS.TipCategory]::NativeCmdlet # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::NativeCmdlet # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $tip.Urls = @(
'https://devblogs.microsoft.com/powershell/announcing-psreadline-2-1-with-predictive-intellisense/'
'https://learn.microsoft.com/en-us/powershell/module/psreadline/'
)
$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Terminal # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Get-ChildItem `
$tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3#line-continuation'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ $tip.Urls = @(
'https://adamtheautomator.com/powershell-splatting/'
'https://4sysops.com/archives/use-splatting-and-psboundparameters-to-pass-parameters-in-powershell/'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ $tip.Urls = @(
'https://devblogs.microsoft.com/scripting/maximizing-the-power-of-here-string-in-powershell-for-configuration-data'

)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ $tip.Urls = @(
'https://devblogs.microsoft.com/powershell/checking-for-bound-parameters/'
'https://www.reza-aghaei.com/how-to-determine-if-a-parameter-is-passed-to-a-powershell-cmdlet/'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
2 changes: 1 addition & 1 deletion src/PowerShellTips/2023-09-22-avoid-array-addition.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ foreach ($i in 0..10) {
$tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/performance/script-authoring-considerations?view=powershell-7.3#array-addition'
)
$tip.Category = [tiPS.TipCategory]::Performance # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Performance # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ $tip.Example = @'
$tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-arrays?view=powershell-7.3#create-an-array'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ $tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_enum#enumerations-as-flags'
'https://arcanecode.com/2021/12/06/fun-with-powershell-enum-flags/'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $PSVersionTable
$tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables#psversiontable'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Test-ValidateSet -Value # Tab complete here to see the dynamic values.
$tip.Urls = @(
'https://www.linkedin.com/feed/update/urn:li:activity:7113300637735407618/'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ $tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-temporaryfile'
'https://learn.microsoft.com/en-us/dotnet/api/system.io.path.gettempfilename#system-io-path-gettempfilename'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.

# Community: Social events and community resources. e.g. PowerShell Summit, podcasts, etc.
# Editor: Editor tips and extensions. e.g. VSCode, ISE, etc.
# Module: Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
# NativeCmdlet: Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
# Performance: Tips to improve performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Performance: Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Security: Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
# Syntax: Syntax tips. e.g. splatting, pipeline, etc.
# Terminal: Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
# Other: Tips that don't fit into any of the other categories.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ $tip.Urls = @(
'https://xainey.github.io/2016/powershell-classes-and-concepts/'
'https://blog.danskingdom.com/PowerShell-class-definition-pros-cons-and-performance-comparison/'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.

# Community: Social events and community resources. e.g. PowerShell Summit, podcasts, etc.
# Editor: Editor tips and extensions. e.g. VSCode, ISE, etc.
# Module: Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
# NativeCmdlet: Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
# Performance: Tips to improve performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Performance: Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Security: Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
# Syntax: Syntax tips. e.g. splatting, pipeline, etc.
# Terminal: Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
# Other: Tips that don't fit into any of the other categories.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ $tip.Urls = @(
'https://www.powershellsummit.org/'
'https://sessionize.com/pshsummit24/'
)
$tip.Category = [tiPS.TipCategory]::Community # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Community # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.

# Community: Social events and community resources. e.g. PowerShell Summit, podcasts, etc.
# Editor: Editor tips and extensions. e.g. VSCode, ISE, etc.
# Module: Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
# NativeCmdlet: Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
# Performance: Tips to improve performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Performance: Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Security: Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
# Syntax: Syntax tips. e.g. splatting, pipeline, etc.
# Terminal: Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
# Other: Tips that don't fit into any of the other categories.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ $tip.Urls = @(
'https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-switch#-file'
'https://twitter.com/dfinke/status/1698733677285388581'
)
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Syntax # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.

# Community: Social events and community resources. e.g. PowerShell Summit, podcasts, etc.
# Editor: Editor tips and extensions. e.g. VSCode, ISE, etc.
# Module: Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
# NativeCmdlet: Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
# Performance: Tips to improve performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Performance: Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Security: Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
# Syntax: Syntax tips. e.g. splatting, pipeline, etc.
# Terminal: Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
# Other: Tips that don't fit into any of the other categories.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ $tip.Urls = @(
'https://devblogs.microsoft.com/powershell/secretmanagement-and-secretstore-are-generally-available/'
'https://www.pdq.com/blog/how-to-manage-powershell-secrets-with-secretsmanagement/'
)
$tip.Category = [tiPS.TipCategory]::Other # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
$tip.Category = [tiPS.TipCategory]::Security # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.

# Community: Social events and community resources. e.g. PowerShell Summit, podcasts, etc.
# Editor: Editor tips and extensions. e.g. VSCode, ISE, etc.
# Module: Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
# NativeCmdlet: Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
# Performance: Tips to improve performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Performance: Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Security: Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
# Syntax: Syntax tips. e.g. splatting, pipeline, etc.
# Terminal: Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
# Other: Tips that don't fit into any of the other categories.
5 changes: 3 additions & 2 deletions tools/New-PowerShellTip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ Example code to demonstrate the tip. This can also be multiple lines if needed.
'https://OneTwoOrThreeUrls'
'https://ToLearnMoreAboutTheTip'
)
`$tip.Category = [tiPS.TipCategory]::Other # Community, Editor, Module, NativeCmdlet, Performance, Syntax, Terminal, or Other.
`$tip.Category = [tiPS.TipCategory]::Other # Community, Editor, Module, NativeCmdlet, Performance, Security, Syntax, Terminal, or Other.
# Community: Social events and community resources. e.g. PowerShell Summit, podcasts, etc.
# Editor: Editor tips and extensions. e.g. VSCode, ISE, etc.
# Module: Modules and module tips. e.g. PSScriptAnalyzer, Pester, etc.
# NativeCmdlet: Native cmdlet tips. e.g. Get-Process, Get-ChildItem, Get-Content, etc.
# Performance: Tips to improve performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Performance: Tips to improve runtime performance. e.g. foreach vs ForEach-Object, ForEach-Object -Parallel, etc.
# Security: Security tips. e.g. ExecutionPolicy, Constrained Language Mode, passwords, etc.
# Syntax: Syntax tips. e.g. splatting, pipeline, etc.
# Terminal: Terminal shortcuts and tips. e.g. PSReadLine, Windows Terminal, ConEmu, etc.
# Other: Tips that don't fit into any of the other categories.
Expand Down

0 comments on commit bd7e0ab

Please sign in to comment.