Skip to content

Commit 8c2dd20

Browse files
authored
Updates and Additions to Features/database table access (#1)
* Updated Docs * Fixed formatting Issues * Fixed formatting Issues * Removed ExecuteAsSqlReader, added ExecuteAsDataRows * Missing $This.GetSqlCommand * Added [void]$instance.AddQuery() * Added ParameterSetName * Added Test Database and Pester test * Added Database Maintenance Functions * Refactored Function Names * Readme Updates * Readme updates with build details * Readme updates with build details
1 parent 08363d3 commit 8c2dd20

13 files changed

Lines changed: 756 additions & 384 deletions

README.md

Lines changed: 198 additions & 95 deletions
Large diffs are not rendered by default.

git_cheatsheet.md

Lines changed: 80 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
# CheetSheet
2+
13
& "C:\Program Files (x86)\Info Keep\info keep.exe"
24

3-
Photography Co-worker Kevin Hecht (kevin.a.hecht@pwc.com)
5+
Photography Co-worker [Kevin Hecht](mailto://kevin.a.hecht@pwc.com)
46

5-
# To Publish Module to PowerShell Gallery
7+
## To Publish Module to PowerShell Gallery
68

9+
```powershell
710
Publish-Module -Path <Path> -NuGetApiKey <APIKey> -Repository PSGallery
811
912
Publish-Module -Path "C:\Git\SqlQueryClass\dist\SqlQueryClass" -NuGetApiKey "" -Repository PSGallery
@@ -40,42 +43,45 @@ AdditionalMetadata : @{summary=Module that create an instance of a Power
4043
isLatestVersion=True; CompanyName=Unknown; Functions=New-SqlQueryDataSet; FileList=SqlQueryClass.nuspec|about_SqlQueryClass.help.txt|SqlQueryClass.psd1|SqlQueryClass.psm1;
4144
PowerShellHostVersion=5.1; created=2/6/2025 3:43:39 AM -05:00; isAbsoluteLatestVersion=True; copyright=(c) Brooks Vaughn. All rights reserved.; packageSize=15464; developmentDependency=False;
4245
updated=2025-02-06T03:43:39Z; published=2/6/2025 3:43:39 AM -05:00}
46+
```
4347

44-
45-
46-
# Code Signing
48+
## Code Signing
4749

4850
Get-ChildItem -Path Cert:\CurrentUser -Recurse | FL
4951
Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert
5052
Get-ChildItem -Path Cert:\LocalMachine -Recurse | FL
5153

52-
# git config commands
54+
## git config commands
5355

5456
- ps.readinglist.md -- Quick Reference Reading list of helpful PowerShell sites, articles, and documents
5557

5658
### Support for Long Paths
5759

5860
git config --system core.longpaths true
5961

60-
### git remote urls
62+
#### git remote urls
6163

6264
git remote -v
6365

6466
## User Config
6567

6668
### To Set your username
6769

70+
```powershell
6871
git config --global user.name "FIRST_NAME LAST_NAME"
72+
```
6973

7074
### To Set your email address
7175

76+
```powershell
7277
git config --global user.email "MY_NAME@example.com"
7378
7479
git config --global user.name "Brooks Vaughn"
7580
git config --global user.email "18422308+BrooksV@users.noreply.github.com"
7681
7782
git config --worktree user.name "Brooks Vaughn"
7883
git config --global user.email "18422308+BrooksV@users.noreply.github.com"
84+
```
7985

8086
### Check configuration for your user
8187

@@ -85,54 +91,71 @@ $ cat $HOME/.gitconfig
8591

8692
### Get system value
8793

94+
```powershell
8895
git config --system --get https.proxy
8996
git config --system --get http.proxy
97+
```
9098

9199
### Get global value
92100

101+
```powershell
93102
git config --global --get https.proxy
94103
git config --global --get http.proxy
104+
```
95105

96106
### Unset system value
97107

98-
$ git config --system --unset https.proxy
99-
$ git config --system --unset http.proxy
108+
```powershell
109+
git config --system --unset https.proxy
110+
git config --system --unset http.proxy
111+
```
100112

101113
### Unset global value
102114

103-
$ git config --global --unset https.proxy
104-
$ git config --global --unset http.proxy
115+
```powershell
116+
git config --global --unset https.proxy
117+
git config --global --unset http.proxy
118+
```
105119

106120
## Proxy Config using Environment Variables
107121

108122
Your proxy could also be set as an environment variable. Check if your environment has any of the env variables http_proxy or https_proxy set up and unset them. Examples of how to set up:
109123

110124
### Linux
111125

126+
```bash
112127
export http_proxy=http://proxy:8080
113128
export https_proxy=https://proxy:8443
129+
```
114130

115131
### Windows
116132

133+
```powershell
117134
set http_proxy http://proxy:8080
118135
set https_proxy https://proxy:8443
136+
```
119137

120138
## SSL Config
121139

140+
```powershell
122141
git config --global http.sslVerify
123142
git config --global http.sslVerify true
143+
```
124144

125145
### Repro Clone SSL Errors
126146

147+
```powershell
127148
SSL_VERIFY=false
128149
git config --global http.sslVerify false
150+
```
129151

130152
My agents are running as Network Service too but that wasn't really a problem to use user level config. Here is what I did:
131153
1.Save all the necessary certificates in folder %systemroot%\ServiceProfiles\NetworkService\.gitcerts\.
132154
2.Create a file at %systemroot%\ServiceProfiles\NetworkService\.gitconfig with the following content:
133155

134156
[http "https://tfs.com/"](http "https://tfs.com/")
135-
sslCAInfo = ~/.gitcerts/certificate.pem
157+
158+
$sslCAInfo = ~/.gitcerts/certificate.pem
136159

137160
[adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store](https://blogs.msdn.microsoft.com/phkelley/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store/)
138161

@@ -141,7 +164,7 @@ git config --global http.sslBackend schannel
141164
[how-to-make-git-work-with-self-signed-ssl-certificates-on-tfs2018](https://www.benday.com/2017/12/15/how-to-make-git-work-with-self-signed-ssl-certificates-on-tfs2018/)
142165
[fix-git-self-signed-certificate-in-certificate-chain-on-windows](https://mattferderer.com/fix-git-self-signed-certificate-in-certificate-chain-on-windows)
143166

144-
# Git Repo and Branch Commands
167+
## Git Repo and Branch Commands
145168

146169
### Reset Local Master
147170

@@ -158,22 +181,24 @@ git checkout main
158181
git reset --hard origin/main
159182
git pull origin main
160183

161-
If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command.
184+
If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command.
162185

186+
```powershell
163187
Example:
164188
git switch -c <new-branch-name>
165189
166190
Or undo this operation with:
167-
git switch -
191+
git switch -?
192+
```
168193

169194
## Status and Info Commands
170195

196+
```powershell
171197
git status
172198
git log
173199
git branch --all
174200
git branch features/<Branch name>
175201
176-
177202
git fetch origin
178203
git fetch origin master
179204
git checkout master
@@ -184,76 +209,88 @@ git status
184209
git log
185210
git push
186211
187-
188212
git pull
189213
git branch -a
214+
```
190215

191216
## To Create Branch from Master
192217

218+
```powershell
193219
git fetch origin master
194220
git checkout master
195221
git pull origin master
196222
git checkout -b features/???
197223
git push --set-upstream origin features/???
198224
git checkout features/???
225+
```
199226

200227
### Create local branch
201228

229+
```powershell
202230
git checkout -b features/<branch name>
203231
git status
204232
git add foo.txt
205233
git commit -m "<comment>"
206-
git commit -a -m "<comment>" # ?
234+
git commit -a -m "<comment>" ## ?
207235
git push
236+
```
208237

209238
### Create Branch on origin (UpStream) to Repository
210239

240+
```powershell
211241
git push --set-upstream origin features/<branch name>
242+
```
212243

213244
### To sync local master
214245

246+
```powershell
215247
git checkout master
216248
git pull
217249
218250
git checkout features/readme-updates
219251
git merge master ????
252+
```
220253

221-
# Notes
254+
## Notes
222255

223256
Origin is the plcae where the branch was cloned from
224257

258+
```powershell
225259
git remote add <name> <url>
226260
git add -p
227261
git log --online
228262
229263
npm config set strict-ssl false
264+
```
230265

266+
## Git Merging commands
231267

232-
# Git Merging commands
233-
268+
```powershell
234269
git merge branch master
235270
git status
236271
git log
237272
git push
238273
239-
240274
git config --get --local core.filemode
241275
false
242276
243277
git config --local --list
278+
```
244279

245280
## Commits
246281

282+
```powershell
247283
git add yaml\???.yml
248284
git commit -m "???"
249-
git commit -a -m "<comment>" # ?
285+
git commit -a -m "<comment>" ## ?
250286
git push
251287
git merge --abort
252288
git branch -a --sort=-committerdate --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
253289
(git reflog > reflog.md) | Invoke-Item
254290
git reflog | Select-String <issue trackerID>
291+
```
255292

256-
### Explanation of what each of those Git commands do
293+
## Explanation of what each of those Git commands do
257294

258295
### `git add yaml???.yml`
259296

@@ -307,12 +344,14 @@ These commands cover a range of Git operations, from staging and committing chan
307344

308345
## Git Command docs
309346

347+
```powershell
310348
git remote add upstream
311349
git fetch upstream
312350
git rebase upstream/master
313351
git push origin master --force
352+
```
314353

315-
### Explanation of what each of those Git commands does:
354+
## Explanation of what each of those Git commands does
316355

317356
### `git remote add upstream`
318357

@@ -358,8 +397,9 @@ git push origin master --force
358397
- **Purpose**: To overwrite the remote `master` branch with your local changes, even if it results in non-fast-forward updates.
359398
- **Example**: Use with caution as it can overwrite changes in the remote repository that others may be relying on.
360399

361-
# 2025-02-05 22:59:55
400+
## 2025-02-05 22:59:55
362401

402+
```powershell
363403
git pull origin main
364404
365405
git checkout -b features/readme-updates
@@ -369,4 +409,17 @@ git commit -m ""
369409
370410
git commit -a -m "Updated SQL query class and added error handling"
371411
372-
git push
412+
git push
413+
```
414+
415+
```powershell
416+
```
417+
418+
```powershell
419+
```
420+
421+
```powershell
422+
```
423+
424+
```powershell
425+
```

project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"ProjectName": "SqlQueryClass",
33
"Description": "Module that create an instance of a PowerShell class which is used to execute SQL Queries and manages output as DataTable, DataAdapter, DataSet, SqlReader, or NonQuery result object.",
4-
"Version": "0.1.0",
4+
"Version": "0.1.1",
55
"Manifest": {
66
"Author": "Brooks Vaughn",
77
"PowerShellHostVersion": "5.1",

0 commit comments

Comments
 (0)