Skip to content

Commit c32a263

Browse files
committed
feat: add Dev folder and test module "PSProfileTools"
1 parent 702e251 commit c32a263

37 files changed

+1378
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// When enabled, will trim trailing whitespace when you save a file.
3+
"files.trimTrailingWhitespace": true
4+
}

Dev/PSProfileTools/.vscode/tasks.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Available variables which can be used inside of strings.
2+
// ${workspaceRoot}: the root folder of the team
3+
// ${file}: the current opened file
4+
// ${relativeFile}: the current opened file relative to workspaceRoot
5+
// ${fileBasename}: the current opened file's basename
6+
// ${fileDirname}: the current opened file's dirname
7+
// ${fileExtname}: the current opened file's extension
8+
// ${cwd}: the current working directory of the spawned process
9+
{
10+
// See https://go.microsoft.com/fwlink/?LinkId=733558
11+
// for the documentation about the tasks.json format
12+
"version": "2.0.0",
13+
14+
// Start PowerShell
15+
"windows": {
16+
"command": "${env:windir}/System32/WindowsPowerShell/v1.0/powershell.exe",
17+
//"command": "${env:ProgramFiles}/PowerShell/6.0.0/powershell.exe",
18+
"args": [ "-NoProfile", "-ExecutionPolicy", "Bypass" ]
19+
},
20+
"linux": {
21+
"command": "/usr/bin/powershell",
22+
"args": [ "-NoProfile" ]
23+
},
24+
"osx": {
25+
"command": "/usr/local/bin/powershell",
26+
"args": [ "-NoProfile" ]
27+
},
28+
29+
// Associate with test task runner
30+
"tasks": [
31+
{
32+
"taskName": "Test",
33+
"suppressTaskName": true,
34+
"isTestCommand": true,
35+
"args": [
36+
"Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -Script test -PesterOption @{IncludeVSCodeMarker=$true};",
37+
"Invoke-Command { Write-Host 'Completed Test task in task runner.' }"
38+
],
39+
"problemMatcher": "$pester"
40+
}
41+
]
42+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
#
2+
# Module manifest for module 'PSProfileTools'
3+
#
4+
# Generated by: jimmy
5+
#
6+
# Generated on: 5/3/2022
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = 'PSProfileTools.psm1'
13+
14+
# Version number of this module.
15+
ModuleVersion = '0.0.2'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = '30ae379c-65bd-4d8b-8443-75ec5227f4e6'
22+
23+
# Author of this module
24+
Author = 'jimmy'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Unknown'
28+
29+
# Copyright statement for this module
30+
Copyright = '(c) jimmy. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
# Description = ''
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+
74+
# 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.
75+
CmdletsToExport = '*'
76+
77+
# Variables to export from this module
78+
VariablesToExport = '*'
79+
80+
# 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.
81+
AliasesToExport = '*'
82+
83+
# DSC resources to export from this module
84+
# DscResourcesToExport = @()
85+
86+
# List of all modules packaged with this module
87+
# ModuleList = @()
88+
89+
# List of all files packaged with this module
90+
# FileList = @()
91+
92+
# 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.
93+
PrivateData = @{
94+
95+
PSData = @{
96+
97+
# Tags applied to this module. These help with module discovery in online galleries.
98+
# Tags = @()
99+
100+
# A URL to the license for this module.
101+
# LicenseUri = ''
102+
103+
# A URL to the main website for this project.
104+
# ProjectUri = ''
105+
106+
# A URL to an icon representing this module.
107+
# IconUri = ''
108+
109+
# ReleaseNotes of this module
110+
# ReleaseNotes = ''
111+
112+
# Prerelease string of this module
113+
# Prerelease = ''
114+
115+
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
116+
# RequireLicenseAcceptance = $false
117+
118+
# External dependent modules of this module
119+
# ExternalModuleDependencies = @()
120+
121+
} # End of PSData hashtable
122+
123+
} # End of PrivateData hashtable
124+
125+
# HelpInfo URI of this module
126+
# HelpInfoURI = ''
127+
128+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
129+
# DefaultCommandPrefix = ''
130+
131+
}
132+
133+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Implement your module commands in this script.
2+
3+
4+
# Export only the functions using PowerShell standard verb-noun naming.
5+
# Be sure to list each exported functions in the FunctionsToExport field of the module manifest file.
6+
# This improves performance of command discovery in PowerShell.
7+
Export-ModuleMember -Function *-*
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#-------------------------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4+
#-------------------------------------------------------------------------------------------------------------
5+
6+
FROM mcr.microsoft.com/powershell:latest
7+
8+
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
9+
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
10+
# will be updated to match your local UID/GID (when using the dockerFile property).
11+
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
12+
ARG USERNAME=vscode
13+
ARG USER_UID=1000
14+
ARG USER_GID=$USER_UID
15+
16+
# install git iproute2, process tools
17+
RUN apt-get update && apt-get -y install git openssh-client less iproute2 procps \
18+
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
19+
&& groupadd --gid $USER_GID $USERNAME \
20+
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
21+
# [Optional] Add sudo support for the non-root user
22+
&& apt-get install -y sudo \
23+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
24+
&& chmod 0440 /etc/sudoers.d/$USERNAME \
25+
#
26+
# Clean up
27+
&& apt-get autoremove -y \
28+
&& apt-get clean -y \
29+
&& rm -rf /var/lib/apt/lists/*
30+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "PowerShell",
3+
"dockerFile": "Dockerfile",
4+
// "image": "mcr.microsoft.com/powershell",
5+
6+
// Set *default* container specific settings.json values on container create.
7+
"settings": {
8+
"terminal.integrated.shell.linux": "/usr/bin/pwsh"
9+
},
10+
11+
// Add the IDs of extensions you want installed when the container is created.
12+
"extensions": [
13+
"ms-vscode.powershell",
14+
"davidanson.vscode-markdownlint"
15+
],
16+
17+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
18+
// "forwardPorts": [],
19+
20+
// Bootstrap build modules
21+
"postCreateCommand": "pwsh -c './build.ps1 -Task Init -Bootstrap'",
22+
23+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
24+
// "remoteUser": "vscode"
25+
}
26+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -crlf
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# How to contribute
2+
3+
Contributions to PSTools are highly encouraged and desired.
4+
Below are some guidelines that will help make the process as smooth as possible.
5+
6+
## Getting Started
7+
8+
- Make sure you have a [GitHub account](https://github.com/signup/free)
9+
- Submit a new issue, assuming one does not already exist.
10+
- Clearly describe the issue including steps to reproduce when it is a bug.
11+
- Make sure you fill in the earliest version that you know has the issue.
12+
- Fork the repository on GitHub
13+
14+
## Suggesting Enhancements
15+
16+
I want to know what you think is missing from PSTools and how it can be made better.
17+
18+
- When submitting an issue for an enhancement, please be as clear as possible about why you think the enhancement is needed and what the benefit of it would be.
19+
20+
## Making Changes
21+
22+
- From your fork of the repository, create a topic branch where work on your change will take place.
23+
- To quickly create a topic branch based on master; `git checkout -b my_contribution master`.
24+
Please avoid working directly on the `master` branch.
25+
- Make commits of logical units.
26+
- Check for unnecessary whitespace with `git diff --check` before committing.
27+
- Please follow the prevailing code conventions in the repository.
28+
Differences in style make the code harder to understand for everyone.
29+
- Make sure your commit messages are in the proper format.
30+
31+
```
32+
Add more cowbell to Get-Something.ps1
33+
34+
The functionality of Get-Something would be greatly improved if there was a little
35+
more 'pizzazz' added to it. I propose a cowbell. Adding more cowbell has been
36+
shown in studies to both increase one's mojo, and cement one's status
37+
as a rock legend.
38+
```
39+
40+
- Make sure you have added all the necessary Pester tests for your changes.
41+
- Run _all_ Pester tests in the module to assure nothing else was accidentally broken.
42+
43+
## Documentation
44+
45+
I am infallible and as such my documenation needs no corectoin.
46+
In the highly unlikely event that that is _not_ the case, commits to update or add documentation are highly apprecaited.
47+
48+
## Submitting Changes
49+
50+
- Push your changes to a topic branch in your fork of the repository.
51+
- Submit a pull request to the main repository.
52+
- Once the pull request has been reviewed and accepted, it will be merged with the master branch.
53+
- Celebrate
54+
55+
## Additional Resources
56+
57+
- [General GitHub documentation](https://help.github.com/)
58+
- [GitHub forking documentation](https://guides.github.com/activities/forking/)
59+
- [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
60+
- [GitHub Flow guide](https://guides.github.com/introduction/flow/)
61+
- [GitHub's guide to contributing to open source projects](https://guides.github.com/activities/contributing-to-open-source/)
62+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--- Provide a general summary of the issue in the Title above -->
2+
3+
## Expected Behavior
4+
<!--- If you're describing a bug, tell us what should happen -->
5+
<!--- If you're suggesting a change/improvement, tell us how it should work -->
6+
7+
## Current Behavior
8+
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
9+
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
10+
11+
## Possible Solution
12+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
13+
<!--- or ideas how to implement the addition or change -->
14+
15+
## Steps to Reproduce (for bugs)
16+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
17+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
18+
1.
19+
2.
20+
3.
21+
4.
22+
23+
## Context
24+
<!--- How has this issue affected you? What are you trying to accomplish? -->
25+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
26+
27+
## Your Environment
28+
<!--- Include as many relevant details about the environment you experienced the bug in -->
29+
* Module version used:
30+
* Operating System and PowerShell version:
31+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!--- Describe your changes in detail -->
5+
6+
## Related Issue
7+
<!--- This project only accepts pull requests related to open issues -->
8+
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
9+
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
10+
<!--- Please link to the issue here: -->
11+
12+
## Motivation and Context
13+
<!--- Why is this change required? What problem does it solve? -->
14+
15+
## How Has This Been Tested?
16+
<!--- Please describe in detail how you tested your changes. -->
17+
<!--- Include details of your testing environment, and the tests you ran to -->
18+
<!--- see how your change affects other areas of the code, etc. -->
19+
20+
## Screenshots (if appropriate):
21+
22+
## Types of changes
23+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
24+
- [ ] Bug fix (non-breaking change which fixes an issue)
25+
- [ ] New feature (non-breaking change which adds functionality)
26+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
27+
28+
## Checklist:
29+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
30+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
31+
- [ ] My code follows the code style of this project.
32+
- [ ] My change requires a change to the documentation.
33+
- [ ] I have updated the documentation accordingly.
34+
- [ ] I have read the **CONTRIBUTING** document.
35+
- [ ] I have added tests to cover my changes.
36+
- [ ] All new and existing tests passed.
37+

0 commit comments

Comments
 (0)