Blog
Projects
About
Backtrack:
Blog
›
Add your own cmdlets to your P…
Comments
Add your own cmdlets to your PowerShell profile
posted on April 19th 2013, at 10:23
by
lunarg
To make your custom cmdlets (functions) available in your PowerShell sessions, there are a few methods.
To do a one-time import of functions in your current session, store the functions in a PS1-file and save it somewhere. Then, in your session run the following:
. "path-to-file"
Notice the dot and a space behind it. This method, called "dotting" does a one-time import in the current session. This is useful for when you have functions that you don't use often, and don't want them to be available at all times.
An alternative method is to save the functions as a PSM1-file (extension .psm1) to create a module file, then use Import-Module to import your functions.
Import
...
read more
add a comment
Tags
computer
windows
software
vmware
microsoft
linux
exchange
hardware
network
news
mac
powershell
home
office365
msoffice
ad
server
sqlserver
dell
soaring
esx
internet
mssql
rds
sbs
events
powercli
terminalserver
virtualization
antivirus
Archive
«
‹
November 2024
›
»
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Links
-
@harkx
-
Cats & Dogs
-
Jargon-free Security Guide
Quote
«
If the batteries of a TV remote run out, why do we press the buttons so much harder?
»
Contact
© 2009-2024 Black Manticore – all rights reserved
code by
lunarg
, design by
SuriAmanah
, hosted at Cats&Dogs