Skip to content

Commit 59a6577

Browse files
committed
Update readme formating.
1 parent b58996c commit 59a6577

File tree

4 files changed

+60
-22
lines changed

4 files changed

+60
-22
lines changed

Functions/Find-NthIndexOf.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
PS C:\> ($dn = "CN=dotps1,OU=Users,DC=domain,DC=org").SubString((Find-NthIndexOf -Target $dn -Value "=" -Nth 2) - 2)
4545
OU=Users,DC=domain,DC=org
4646
.Example
47-
PS C:\> Find-NthIndexOf -Target "Hello World." -Value "w" -IgnoreCase
47+
PS C:\> Find-NthIndexOf -Target "Hello World." -Value "w" -IgnoreCase -Nth 1
4848
6
4949
.Notes
5050
Returns -1 if the char does not exist, or if nth is out of range.

Functions/New-NetStaticIPAddress.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
.Synopsis
2626
Sets a static IP Address on a Network Adapter.
2727
.Description
28-
Removes the current NetIPAddress and NetRoute on a given NetAdapter.
29-
Sets a new Static NetIPAddress and adds DNS Server values if provided.
28+
Removes the current NetIPAddress and NetRoute on a given NetAdapter. Sets a new Static NetIPAddress and adds DNS Server values if provided.
3029
.Inputs
3130
Microsoft.Management.Infrastructure.CimSession
3231
Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetIPAddress.AddressFamily

Functions/Test-WannaCryVulnerability.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
SMB1FeatureEnabled : False
4646
SMB1ProtocolEnabled : False
4747
.Example
48-
PS C:\> Get-ADComputer -Filter * -OrganizationalUnit OU=workstations,DC=domain,DC=org | Test-WannaCryVulnerability
48+
PS C:\> Get-ADComputer -Identity workstation | Test-WannaCryVulnerability
4949
5050
PSComputerName : workstation
5151
OperatingSystem : Microsoft Windows 7 Professional

README.md

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ So they are contained in single .ps1 files that can be installed using `Install-
99
---
1010

1111
### ConvertTo-ShortPath
12+
Converts each element of a file object path to the 8.3 path and return the short path string.
1213

1314
```
1415
PS C:\Users\dotps1\Documents\GitHub\PSFunctions\Functions> ConvertTo-ShortPath
@@ -18,7 +19,10 @@ PS C:\> Get-Item $env:WinDir\System32\WindowsPowerShell\v1.0\powershell.exe | .\
1819
C:\Windows\System32\WINDOW~1\v1.0\powershell.exe
1920
```
2021

22+
---
23+
2124
### Enable-WindowsStore
25+
Sets the registry that disables the Windows Store to "0", which will temporarily allow access to the Windows Store.
2226

2327
```
2428
PS C:\> Enable-WindowsStore
@@ -30,7 +34,10 @@ PS C:\> Enable-WindowsStore -Credential (Get-Credential)
3034
PS C:\> Get-Credential | Enable-WindowsStore
3135
```
3236

37+
---
38+
3339
### Find-NthIndexOf
40+
Finds the nth index of a char in a string, returns -1 if the char does not exist, or if nth is out of range.
3441

3542
```
3643
PS C:\> Find-NthIndexOf -Target "CN=me,OU=Users,DC=domain,DC=org" -Value "=" -Nth 2
@@ -41,11 +48,34 @@ PS C:\> ($dn = "CN=dotps1,OU=Users,DC=domain,DC=org").SubString((Find-NthIndexOf
4148
OU=Users,DC=domain,DC=org
4249
4350
44-
PS C:\> Find-NthIndexOf -Target "Hello World." -Value "w" -IgnoreCase
51+
PS C:\> Find-NthIndexOf -Target "Hello World." -Value "w" -IgnoreCase -Nth 1
4552
6
4653
```
4754

55+
---
56+
57+
### Get-ADComputerSiteName
58+
Queries DNS to get the computers IPAddress then, returns the ADSiteName base on AD Sites and Services.
59+
60+
```
61+
PS C:\> Get-ADComputerSiteName
62+
63+
PSComputerName ADSiteName
64+
-------------- ----------
65+
MyComputer Default-First-Site
66+
67+
68+
PS C:\> Get-ADComputer -Filter { Name -like '*Computer*' } | Get-ADComputerSiteName
69+
70+
PSComputerName ADSiteName
71+
-------------- ----------
72+
MyComputer Default-First-Site
73+
```
74+
75+
---
76+
4877
### Get-ItemExtendedAttribute
78+
Get extended item metadeta attribute value from an item using COM and referenced by attribute number.
4979

5080
```
5181
PS C:\> Get-ItemExtendedAttribute -Path .\googlechromestandaloneenterprise.msi -Attribute 24
@@ -83,7 +113,10 @@ Attribute Value
83113
247 ‎43%
84114
```
85115

116+
---
117+
86118
### Get-LastLoggedOnUser
119+
Gets the last not special user to have a loaded profile on a given system.
87120

88121
```
89122
PS C:\> Get-LastLoggedOnUser
@@ -101,24 +134,10 @@ Server1 5/5/2017 9:06:45 AM domain\username True
101134
Server1 5/5/2017 9:06:45 AM domain\username False
102135
```
103136

104-
### Get-ADComputerSiteName
105-
106-
```
107-
PS C:\> Get-ADComputerSiteName
108-
109-
PSComputerName ADSiteName
110-
-------------- ----------
111-
MyComputer Default-First-Site
112-
113-
114-
PS C:\> Get-ADComputer -Filter { Name -like '*Computer*' } | Get-ADComputerSiteName
115-
116-
PSComputerName ADSiteName
117-
-------------- ----------
118-
MyComputer Default-First-Site
119-
```
137+
---
120138

121139
### Get-MsiPropertyValue
140+
Opens a Windows Installer Database (.msi) and queries for the specified property value.
122141

123142
```
124143
PS C:\> Get-MsiPropertyValue -Path .\jre1.8.0_121.msi -Property ProductVersion, ProductCode
@@ -136,7 +155,10 @@ jre1.8.0_111.msi 8.0.1110.14 {26A24AE4-039D-4CA4-87B4-2F32180111F0}
136155
jre1.8.0_121.msi 8.0.1210.13 {26A24AE4-039D-4CA4-87B4-2F32180121F0}
137156
```
138157

158+
---
159+
139160
### Get-ProgramUninstallString
161+
Gets the uninstall string for a program, can be filtered to a key word of the programs display name.
140162

141163
```
142164
PS C:\> Get-ProgramUninstallString -Name "Google Chrome"
@@ -154,7 +176,13 @@ Google Chrome 57.0.2987.110 {4F711ED6-6E14-3607-A3CA-E3282AFE87B6} MsiExe
154176
Google Update Helper 1.3.32.7 {60EC980A-BDA2-4CB6-A427-B07A5498B4CA} MsiExec.exe /I{60EC980A-BDA2-4CB6-A427-B07A5498B4CA}
155177
```
156178

179+
---
180+
157181
### New-ADUserName
182+
Create a new username with the following order until a unique Username is found.
183+
1. First Initial Last Name.
184+
2. First Initial First Middle Initial Last Name.
185+
3. Iterates First Name adding each Char until a unique Username is found.
158186

159187
```
160188
PS C:\> New-Username -FirstName John -LastName Doe
@@ -167,7 +195,10 @@ PS C:\> New-Username -FirstName Jane -LastName Doe -MiddleName Ala
167195
jadoe
168196
```
169197

198+
---
199+
170200
### New-NetStaticIPAddress
201+
Removes the current NetIPAddress and NetRoute on a given NetAdapter. Sets a new Static NetIPAddress and adds DNS Server values if provided.
171202

172203
```
173204
PS C:\> New-NetStaticIPAddress -InterfaceIndex 3 -IPAddress 192.168.1.1 -DefaultGateway 192.168.1.0 -PrefixLength 24 -DnsServerAddress 192.168.1.0 -Confirm:$false
@@ -188,7 +219,10 @@ SkipAsSource : False
188219
PolicyStore : ActiveStore
189220
```
190221

222+
---
223+
191224
### Test-Credential
225+
Simulates an Authentication Request in a Domain environment using a PSCredential Object. Returns $true if both Username and Password pair are valid.
192226

193227
```
194228
PS C:\> Test-Credential -Credential (Get-Credential)
@@ -203,7 +237,12 @@ Credential
203237
PS C:\> Test-Credential -Credential $credential
204238
True
205239
```
240+
241+
---
242+
206243
### Test-WannaCryVulnerability
244+
Test for applicable patches to prevent the WannaCry malware. Tests for SMB1 protocol and component.
245+
207246
```
208247
PS C:\> Test-WannaCryVulnerability
209248
@@ -215,7 +254,7 @@ SMB1FeatureEnabled : False
215254
SMB1ProtocolEnabled : False
216255
217256
218-
PS C:\> Get-ADComputer -Filter * -OrganizationalUnit OU=workstations,DC=domain,DC=org | Test-WannaCryVulnerability
257+
PS C:\> Get-ADComputer -Identity workstation | Test-WannaCryVulnerability
219258
220259
PSComputerName : workstation
221260
OperatingSystem : Microsoft Windows 7 Professional

0 commit comments

Comments
 (0)