You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copyright='(c) 2021 Pierre Smit. All rights reserved.'
31
31
32
32
# Description of the functionality provided by this module
33
-
Description='Creates a Config file with Variables, PSDrives, Credentials, Shortcuts(Functions), PSDefaultParameters and a Starting location. You can then execute this config when your profile is loaded, or you can run it manually at any time. And all of the variables, psdrives credentials ext. are then available in your session. This way you can quickly and easily switch between "environment setups"'
33
+
Description='PSConfigFile is an extension to your PowerShell profile that enables advanced, portable, and modular environment management. It creates a configuration file containing Variables, PSDrives, Credentials, Shortcuts(Functions), PSDefaultParameters, and a Starting Location. You can execute this config automatically when your profile loads, or manually at any time, making all your environment settings instantly available in your session. Effortlessly switch between different environment setups, share configurations across systems, and keep your PowerShell experience consistent and efficient.'
34
34
35
-
# Minimum version of the Windows PowerShell engine required by this module
35
+
# Minimum version of the PowerShell engine required by this module
36
36
# PowerShellVersion = ''
37
37
38
-
# Name of the Windows PowerShell host required by this module
38
+
# Name of the PowerShell host required by this module
39
39
# PowerShellHostName = ''
40
40
41
-
# Minimum version of the Windows PowerShell host required by this module
41
+
# Minimum version of the PowerShell host required by this module
42
42
# PowerShellHostVersion = ''
43
43
44
44
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45
45
# DotNetFrameworkVersion = ''
46
46
47
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 = ''
48
+
#ClrVersion = ''
49
49
50
50
# Processor architecture (None, X86, Amd64) required by this module
# 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.
81
82
CmdletsToExport=@()
@@ -113,7 +114,7 @@ PrivateData = @{
113
114
# IconUri = ''
114
115
115
116
# ReleaseNotes of this module
116
-
ReleaseNotes='Updated [18/09/2022_17:55] added auto remove of old backup files.'
117
+
ReleaseNotes='Updated [01/03/2026_09:32] Removed show function'
Copy file name to clipboardExpand all lines: PSConfigFile/Public/Add-CommandToPSConfigFile.ps1
+17-20Lines changed: 17 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
.AUTHOR Pierre Smit
9
9
10
-
.COMPANYNAME HTPCZA Tech
10
+
.COMPANYNAME Private
11
11
12
12
.COPYRIGHT
13
13
@@ -44,38 +44,38 @@ Updated [13/11/2021_16:30] Added Function Script
44
44
45
45
46
46
47
-
<#
48
-
49
-
.DESCRIPTION
50
-
Add a command to the config file
51
-
52
-
#>
53
-
54
-
55
47
<#
56
48
.SYNOPSIS
57
-
Adds a command or script block to the config file, to be executed every time the invoke function is called.
49
+
Adds a named command or script block to the PSConfigFile configuration, to be executed automatically when the config is invoked.
58
50
59
51
.DESCRIPTION
60
-
Adds a command or script block to the config file, to be executed every time the invoke function is called.
52
+
Use this function to store custom commands or script blocks in your configuration file. These commands will be executed every time the config file is invoked using Invoke-PSConfigFile. This is useful for automating environment setup, running startup tasks, or ensuring certain commands always run in your PowerShell environment.
61
53
62
54
.PARAMETERScriptBlockName
63
-
Name for the script block
55
+
The unique name to assign to the script block. This name is used to identify and manage the command within the config file.
64
56
65
57
.PARAMETERScriptBlock
66
-
The commands to be executed
58
+
The PowerShell command(s) or script block to be executed. Provide as a string. Example: "Get-ChildItem C:\\Logs | Out-File C:\\log.txt"
67
59
68
60
.PARAMETERForce
69
-
Will delete the config file before saving the new one. If false, then the config file will be renamed.
61
+
If specified, the config file will be deleted before saving the new one. If not specified and a config file exists, it will be renamed as a backup before saving the new version.
Copy file name to clipboardExpand all lines: PSConfigFile/Public/Add-CredentialToPSConfigFile.ps1
+22-25Lines changed: 22 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
.AUTHOR Pierre Smit
9
9
10
-
.COMPANYNAME HTPCZA Tech
10
+
.COMPANYNAME Private
11
11
12
12
.COPYRIGHT
13
13
@@ -33,40 +33,40 @@ Created [21/05/2022_03:47] Initial Script Creating
33
33
#>
34
34
35
35
36
-
<#
37
-
38
-
.DESCRIPTION
39
-
Creates a self signed cert, then uses it to securely save a credential to the config file.
40
-
41
-
#>
42
-
43
36
<#
44
37
.SYNOPSIS
45
-
Creates a self signed cert, then uses it to securely save a credential to the config file.
38
+
Securely saves a credential to the PSConfigFile configuration using a self-signed certificate for encryption.
46
39
47
40
.DESCRIPTION
48
-
Creates a self signed cert, then uses it to securely save a credential to the config file.
49
-
You can export the cert, and install it on other machines. Then you would be able to decrypt the password on those machines.
41
+
This function creates a self-signed certificate (if one does not already exist) and uses it to encrypt and store a PowerShell credential object in your configuration file. The certificate can be exported and installed on other machines, allowing you to decrypt and use the credential securely across trusted systems. This is ideal for automating scripts that require credentials without exposing sensitive information in plain text.
50
42
51
43
.PARAMETERName
52
-
This name will be used for the variable when invoke command is executed.
44
+
The variable name to assign to the credential in the config file. This name is used to reference the credential when invoking commands from the config.
53
45
54
46
.PARAMETERCredential
55
-
Credential object to be saved.
47
+
The PowerShell credential object to be securely stored. Use Get-Credential to create this object.
56
48
57
49
.PARAMETERForce
58
-
Will delete the config file before saving the new one. If false, then the config file will be renamed.
59
-
50
+
If specified, the config file will be deleted before saving the new one. If not specified and a config file exists, it will be renamed as a backup before saving the new version.
Copy file name to clipboardExpand all lines: PSConfigFile/Public/Add-FunctionToPSConfigFile.ps1
+17-18Lines changed: 17 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
.AUTHOR Pierre Smit
9
9
10
-
.COMPANYNAME HTPCZA Tech
10
+
.COMPANYNAME Private
11
11
12
12
.COPYRIGHT
13
13
@@ -38,36 +38,38 @@ Updated [18/11/2021_08:31] Changed the update script to Set-PSConfigFileExecutio
38
38
39
39
<#
40
40
41
-
.DESCRIPTION
42
-
Add Function to the config file.
43
-
44
-
#>
45
-
46
-
47
41
<#
48
42
.SYNOPSIS
49
-
Creates Shortcuts (Functions) to commands or script blocks
43
+
Adds a custom function (shortcut) to the PSConfigFile configuration for quick command or script execution.
50
44
51
45
.DESCRIPTION
52
-
Creates Shortcuts (Functions) to commands or script blocks
46
+
This function allows you to define named PowerShell functions (shortcuts) that execute specific commands or script blocks. These functions are stored in your configuration file and can be invoked automatically or manually, streamlining repetitive tasks and environment setup.
53
47
54
48
.PARAMETERFunctionName
55
-
Name to use for the command
49
+
The name to assign to the custom function. This is how you will reference and call the function from your config.
56
50
57
51
.PARAMETERCommandToRun
58
-
Command to run in a string format
52
+
The PowerShell command or script block (as a string) that the function will execute. Example: "Import-Module .\*.psm1 -Force -Verbose"
59
53
60
54
.PARAMETERForce
61
-
Will delete the config file before saving the new one. If false, then the config file will be renamed.
55
+
If specified, the config file will be deleted before saving the new one. If not specified and a config file exists, it will be renamed as a backup before saving the new version.
0 commit comments