Skip to content

Commit 332cc9d

Browse files
committed
updated uri and added ep 13 modules
1 parent 021ea44 commit 332cc9d

20 files changed

+675
-96
lines changed

.github/CHANGELOG.md

-5
This file was deleted.

.vscode/extensions.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"ms-vscode.PowerShell"
5+
"ms-vscode.PowerShell",
6+
"streetsidesoftware.code-spell-checker"
67
]
7-
}
8+
}

.vscode/settings.json

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
{
2-
"powershell.codeFormatting.preset":"Stroustrup"
3-
}
2+
"powershell.codeFormatting.preset": "Stroustrup",
3+
"cSpell.words": [
4+
"COMPUTERNAME",
5+
"creds",
6+
"imgur",
7+
"ipify",
8+
"jakemorrison",
9+
"learnpowershell",
10+
"newcsv",
11+
"notcontains",
12+
"pkgs",
13+
"Pubkey",
14+
"quickconfig",
15+
"RAXDC",
16+
"Remoting",
17+
"sshs",
18+
"Stroustrup",
19+
"techthoughts",
20+
"techthoughtscontainer",
21+
"techthoughtsstorage",
22+
"USCS",
23+
"westus"
24+
]
25+
}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Jake Morrison
3+
Copyright (c) 2022 Jake Morrison
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LearnPowerShell/EP1 - PowerShell Basics.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#____________________________________________________________
2-
# https://techthoughts.info/learn-and-use-powershell-with-just-three-commands/
2+
# https://www.techthoughts.info/learn-and-use-powershell-with-just-three-commands/
33
#____________________________________________________________
44
# your first cmdlet - getting timezone information
55

@@ -38,4 +38,4 @@ Get-Date | Format-List
3838
# Find-Module
3939

4040
Find-Module -Tag Telegram
41-
#____________________________________________________________
41+
#____________________________________________________________

LearnPowerShell/EP10 - PowerShell Script.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#____________________________________________________________
2-
# https://techthoughts.info/powershell-scripts/
2+
# https://www.techthoughts.info/powershell-scripts/
33
#____________________________________________________________
44

55
#region links
@@ -108,7 +108,7 @@ catch {
108108
throw
109109
}
110110

111-
#evaluate if a message needs to be sent if the drive is below 20GB freespace
111+
#evaluate if a message needs to be sent if the drive is below 20GB free space
112112
if ($percentFree -le 20) {
113113

114114
try {
@@ -142,4 +142,4 @@ if ($percentFree -le 20) {
142142

143143
}
144144

145-
#endregion
145+
#endregion

LearnPowerShell/EP11 - PowerShell Functions.ps1

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#____________________________________________________________
2-
# https://techthoughts.info/powershell-functions/
2+
# https://www.techthoughts.info/powershell-functions/
33
#____________________________________________________________
44

55
#region links
@@ -102,15 +102,15 @@ function Verb-Noun {
102102
.EXAMPLE
103103
Get-Weather -City 'London' -Units Metric -Language 'en'
104104
105-
Returns full weather information for the city of Londa in Metric units with UK language.
105+
Returns full weather information for the city of London in Metric units with UK language.
106106
.EXAMPLE
107107
Get-Weather -City 'San Antonio' -Units USCS -Short
108108
109109
Returns basic weather information for the city of San Antonio in United State customary units.
110110
.PARAMETER City
111111
The city you would like to get the weather from. If not specified the city of your IP is used.
112112
.PARAMETER Units
113-
Units to display Metric vs United States cusomtary units
113+
Units to display Metric vs United States customary units
114114
.PARAMETER Language
115115
Language to display results in
116116
.PARAMETER Short
@@ -280,7 +280,7 @@ Get-NumberTimesTwo -Number 2 -Debug
280280
.PARAMETER URL
281281
i.redd.it or v.redd.it or imgur URL
282282
.NOTES
283-
Jake Morrison - @jakemorrison - https://techthoughts.info
283+
Jake Morrison - @jakemorrison - https://www.techthoughts.info
284284
#>
285285
function Show-Pics {
286286
[CmdletBinding()]
@@ -327,7 +327,7 @@ function Show-Pics {
327327
Get-Reddit -Subreddit aww -Threads 4 -ShowPics
328328
Retrieves the top 4 threads of the aww subreddit and if pictures are available, displays them in the native browser
329329
.NOTES
330-
Jake Morrison - @jakemorrison - https://techthoughts.info
330+
Jake Morrison - @jakemorrison - https://www.techthoughts.info
331331
#>
332332
function Get-Reddit {
333333
[CmdletBinding()]
@@ -407,4 +407,4 @@ function Get-Reddit {
407407

408408
return $results
409409

410-
}#Get-Reddit
410+
}#Get-Reddit

LearnPowerShell/EP12 - Manage Cloud with PowerShell.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#____________________________________________________________
2-
# https://techthoughts.info/manage-cloud-with-powershell/
2+
# https://www.techthoughts.info/manage-cloud-with-powershell/
33
#____________________________________________________________
44

55
#region AWS
@@ -178,4 +178,4 @@ $newStorageSASSplat = @{
178178
}
179179
$url = New-AzStorageBlobSASToken @newStorageSASSplat
180180

181-
#endregion
181+
#endregion
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#____________________________________________________________
2+
# https://www.techthoughts.info/powershell-modules/
3+
#____________________________________________________________
4+
# importing a psm1
5+
6+
# a psm1 module can now be imported
7+
Import-Module .\learnpowershell.psm1
8+
9+
# we can confirm that the module is loaded
10+
Get-Module learnpowershell
11+
12+
# now that the module is imported we can see what commands are available
13+
Get-Command -Module learnpowershell
14+
#____________________________________________________________
15+
# importing a psd1
16+
17+
# create a basic module manifest
18+
New-ModuleManifest -Path C:\learnpowershell\learnpowershell.psd1
19+
20+
# test a module manifest
21+
Test-ModuleManifest .\learnpowershell.psd1
22+
23+
# import a module by specifying the manifest
24+
Import-Module .\learnpowershell.psd1
25+
26+
# we can confirm that the module is loaded
27+
Get-Module learnpowershell
28+
#____________________________________________________________
29+
# using a repository to find and install modules
30+
31+
# the PowerShell Gallery is registered by default
32+
Get-PSRepository
33+
34+
# search for modules that are tagged with the Telegram key word
35+
Find-Module -Tag Telegram | Format-List
36+
37+
# install a module from the PowerShell Gallery
38+
Install-Module -Name PoshGram -Scope CurrentUser
39+
40+
# determine where a module was installed on the system
41+
Get-Module -Name PoshGram -ListAvailable | Select-Object Path
42+
43+
# update installed module
44+
Update-Module -Name PoshGram
45+
46+
# list all modules available on the system
47+
Get-Module -ListAvailable
48+
49+
#____________________________________________________________
50+
# manually installing a module
51+
52+
# PowerShell sources modules from paths specified in the PSModulePath environment variable
53+
$env:PSModulePath
54+
55+
# change dir to the modules install folder
56+
Set-Location $env:USERPROFILE\Documents\PowerShell\Modules
57+
58+
# create a new folder that is the same name as your module
59+
New-Item -Name learnpowershell -ItemType Directory
60+
61+
# copy the psd1 and psm1 files to this new directory
62+
63+
# verify that PowerShell can now source that module
64+
Get-Module learnpowershell -ListAvailable
65+
#____________________________________________________________
66+
# saving a module for testing / evaluation
67+
68+
# save a module to a directory of your choice
69+
Save-Module PoshGram -Path C:\eval -Repository PSGallery
70+
71+
# change directory to the downloaded module
72+
Set-Location 'C:\eval\PoshGram\2.2.2'
73+
74+
# import the module directly for testing and evaluation
75+
Import-Module .\PoshGram.psd1
76+
#____________________________________________________________
77+
# publish your module to the PowerShell Gallery
78+
Publish-Module -Name "learnpowershell" -NuGetApiKey "your-api-key-goes-here" -Repository PSGallery
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#
2+
# Module manifest for module 'LearnPowerShell'
3+
#
4+
# Generated by: Jake Morrison
5+
#
6+
# Generated on: 06/13/22
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = 'LearnPowerShell.psm1'
13+
14+
# Version number of this module.
15+
ModuleVersion = '0.7.0'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = '1240e1b2-fa3a-4617-98cc-25adec29389a'
22+
23+
# Author of this module
24+
Author = 'Jake Morrison'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'TechThoughts'
28+
29+
# Copyright statement for this module
30+
Copyright = '(c) Jake Morrison. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Returns episode information from the Learn PowerShell series. Learn PowerShell in an operationally focused blog and video series. This module contains information about each episode.'
34+
35+
# Minimum version of the PowerShell engine required by this module
36+
# PowerShellVersion = ''
37+
38+
# Name of the PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
# DotNetFrameworkVersion = ''
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# ClrVersion = ''
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
# RequiredModules = @()
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
# RequiredAssemblies = @()
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
# FormatsToProcess = @()
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
# NestedModules = @()
70+
71+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72+
FunctionsToExport = @(
73+
'Get-LearnPowerShellInfo'
74+
)
75+
76+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
77+
# CmdletsToExport = @()
78+
79+
# Variables to export from this module
80+
# VariablesToExport = '*'
81+
82+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
83+
# AliasesToExport = @()
84+
85+
# DSC resources to export from this module
86+
# DscResourcesToExport = @()
87+
88+
# List of all modules packaged with this module
89+
# ModuleList = @()
90+
91+
# List of all files packaged with this module
92+
# FileList = @()
93+
94+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
95+
PrivateData = @{
96+
97+
PSData = @{
98+
99+
# Tags applied to this module. These help with module discovery in online galleries.
100+
Tags = @(
101+
'examples',
102+
'howto',
103+
'learn',
104+
'learn-powershell',
105+
'learn-powershell-series',
106+
'learning-powershell',
107+
'learningpowershell',
108+
'learnpowershell',
109+
'powershell',
110+
'powershellcourse',
111+
'powershell-course',
112+
'powershellexamples'
113+
'powershell-examples'
114+
'powershell-training',
115+
'powershelltraining',
116+
'training',
117+
'training-course'
118+
)
119+
120+
# A URL to the license for this module.
121+
# LicenseUri = ''
122+
123+
# A URL to the main website for this project.
124+
ProjectUri = 'https://github.com/techthoughts2/Learn-PowerShell-Code-Examples'
125+
126+
# A URL to an icon representing this module.
127+
# IconUri = ''
128+
129+
# ReleaseNotes of this module
130+
# ReleaseNotes = ''
131+
132+
# Prerelease string of this module
133+
# Prerelease = ''
134+
135+
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
136+
# RequireLicenseAcceptance = $false
137+
138+
# External dependent modules of this module
139+
# ExternalModuleDependencies = @()
140+
141+
} # End of PSData hashtable
142+
143+
} # End of PrivateData hashtable
144+
145+
# HelpInfo URI of this module
146+
# HelpInfoURI = ''
147+
148+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
149+
# DefaultCommandPrefix = ''
150+
151+
}
152+

0 commit comments

Comments
 (0)