Skip to content

Commit 4b0ce52

Browse files
committed
feat: add 5 new function profile imports
1 parent bd5b869 commit 4b0ce52

5 files changed

+74
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Function Get-NetAccelerators {
2+
[psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::get
3+
}
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
function Get-NetFramework {
2+
<#
3+
.SYNOPSIS
4+
This function will retrieve the list of Framework Installed on the computer.
5+
.DESCRIPTION
6+
This function will retrieve the list of Framework Installed on the computer.
7+
.EXAMPLE
8+
Get-NetFramework
9+
PSChildName Version
10+
----------- -------
11+
v2.0.50727 2.0.50727.4927
12+
v3.0 3.0.30729.4926
13+
Windows Communication Foundation 3.0.4506.4926
14+
Windows Presentation Foundation 3.0.6920.4902
15+
v3.5 3.5.30729.4926
16+
Client 4.5.51641
17+
Full 4.5.51641
18+
Client 4.0.0.0
19+
.NOTES
20+
TODO:
21+
Credential support
22+
ComputerName
23+
$hklm = 2147483650
24+
$key = "SOFTWARE\Microsoft\NET Framework Setup"
25+
$value = "NDP"
26+
Get-wmiobject -list "StdRegProv" -namespace root\default -computername . |
27+
Invoke-WmiMethod -name GetDWORDValue -ArgumentList $hklm,$key,$value | select uvalue
28+
#http://stackoverflow.com/questions/27375012/check-remote-wmi-and-remote-registry
29+
.LINK
30+
https://github.com/lazywinadmin/PowerShell
31+
#>
32+
[CmdletBinding()]
33+
PARAM (
34+
[String[]]$ComputerName,
35+
[pscredential]
36+
$Credential = [System.Management.Automation.PSCredential]::Empty
37+
)
38+
39+
$Splatting = @{
40+
ComputerName = $ComputerName
41+
}
42+
43+
if ($PSBoundParameters['Credential']) { $Splatting.credential = $Credential }
44+
45+
Invoke-Command @Splatting -ScriptBlock {
46+
Write-Verbose -Message "$pscomputername"
47+
48+
# Get the Net Framework Installed
49+
$netFramework = Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
50+
Get-ItemProperty -name Version -EA 0 |
51+
Where-Object -FilterScript { $_.PSChildName -match '^(?!S)\p{L}' } |
52+
Select-Object -Property PSChildName, Version
53+
54+
# Prepare output
55+
$Properties = @{
56+
ComputerName = "$($env:Computername)$($env:USERDNSDOMAIN)"
57+
PowerShellVersion = $psversiontable.PSVersion.Major
58+
NetFramework = $netFramework
59+
}
60+
New-Object -TypeName PSObject -Property $Properties
61+
}
62+
}

Profile/functions/Get-RandomAbout.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Function Get-RandomAbout {
2+
Get-Random -input (Get-Help about*) | Get-Help -ShowWindow
3+
}

Profile/functions/Get-RandomHelp.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Function Get-RandomHelp {
2+
Get-Command -Module Microsoft*, Cim*, PS*, ISE | Get-Random | Get-Help -ShowWindow
3+
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Function Launch-AzurePortal {
2+
Start-Process "https://portal.azure.com/" # -Credential (Get-Credential)
3+
}

0 commit comments

Comments
 (0)