ModuleVersion.psm1
<#
.NOTES -------------------------------------------------------------------------------- Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2019 v5.6.167 Generated on: 8/27/2019 1:35 PM Generated by: Brittney -------------------------------------------------------------------------------- .DESCRIPTION Script generated by PowerShell Studio 2019 #> <# =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2019 v5.6.167 Created on: 8/9/2019 6:45 AM Created by: Brittney Organization: Filename: ModuleVersion.psm1 ------------------------------------------------------------------------- Module Name: ModuleVersion =========================================================================== #> function Write-HelloWorld { Write-Host "Hello World" } function Count-FileExtensions { [CmdletBinding()] param ( [string]$path = "C:\Projects\PowerShell Scripts" ) $total = (Get-ChildItem $path -Recurse -File) | Measure-Object | %{ $_.Count } $AllSum = ($AllFiles | Measure-Object Length -Sum).Sum $result = Get-Childitem $path -Recurse -Exclude "*.dll", "*.exe" | where { -not $_.PSIsContainer } | group Extension | sort count -Descending Write-Output $result } function Show-MsgBox { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)] [string]$Prompt, [Parameter(Position = 1, Mandatory = $false)] [string]$Title = "", [Parameter(Position = 2, Mandatory = $false)] [ValidateSet("Information", "Question", "Critical", "Exclamation")] [string]$Icon = "Information", [Parameter(Position = 3, Mandatory = $false)] [ValidateSet("OKOnly", "OKCancel", "AbortRetryIgnore", "YesNoCancel", "YesNo", "RetryCancel")] [string]$BoxType = "OkOnly", [Parameter(Position = 4, Mandatory = $false)] [ValidateSet(1, 2, 3)] [int]$DefaultButton = 1 ) [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic") | Out-Null switch ($Icon) { "Question" { $vb_icon = [microsoft.visualbasic.msgboxstyle]::Question } "Critical" { $vb_icon = [microsoft.visualbasic.msgboxstyle]::Critical } "Exclamation" { $vb_icon = [microsoft.visualbasic.msgboxstyle]::Exclamation } "Information" { $vb_icon = [microsoft.visualbasic.msgboxstyle]::Information } } switch ($BoxType) { "OKOnly" { $vb_box = [microsoft.visualbasic.msgboxstyle]::OKOnly } "OKCancel" { $vb_box = [microsoft.visualbasic.msgboxstyle]::OkCancel } "AbortRetryIgnore" { $vb_box = [microsoft.visualbasic.msgboxstyle]::AbortRetryIgnore } "YesNoCancel" { $vb_box = [microsoft.visualbasic.msgboxstyle]::YesNoCancel } "YesNo" { $vb_box = [microsoft.visualbasic.msgboxstyle]::YesNo } "RetryCancel" { $vb_box = [microsoft.visualbasic.msgboxstyle]::RetryCancel } } switch ($Defaultbutton) { 1 { $vb_defaultbutton = [microsoft.visualbasic.msgboxstyle]::DefaultButton1 } 2 { $vb_defaultbutton = [microsoft.visualbasic.msgboxstyle]::DefaultButton2 } 3 { $vb_defaultbutton = [microsoft.visualbasic.msgboxstyle]::DefaultButton3 } } $popuptype = $vb_icon -bor $vb_box -bor $vb_defaultbutton $ans = [Microsoft.VisualBasic.Interaction]::MsgBox($prompt, $popuptype, $title) return $ans } #end function |