Join Don Jones for an in-depth discussion in this video Add a module-level setting variable, part of PowerShell 3.0: Scripting and Tool Making.
- There's one more thing I'd like to do to this module.…I'm going to create a top level variable for this module…we're going to call it D J error log file.…And I'm going to give it a default…value of C errors dot txt.…Here in my module, if you remember,…back when we did error handling,…I set this up to write to that file.…I'm just going to have it use that…variable now, D J error log file.…
Whenever you create a module, Power Shell makes…everything in it visible to whoever loads the module.…You don't have to let that be the case.…If you've created certain variables…that are for internal use only, you can hide them.…It's a little bit of a backwards process.…You see, by default, if I don't…do anything, everything is made visible.…If I want some things to be hidden,…I have to explicitly export only those module…items that I want to be visible.…So I'm not really hiding something,…I'm taking the step to specifically…expose only those that I want to.…
So we're going to expose the get DJOS info function…and we're going to export the DJ error log file variable.…
Author
Released
4/5/2012Skill Level Advanced
Duration
Views
Related Courses
-
PowerShell 3.0 for Administrators
with Don Jones4h 13m Intermediate -
PowerShell: DrillBits
with Don Jones1h 32m Beginner -
PowerShell: Web Access
with Jason C. Helmick1h 31m Intermediate
-
1. Scripting Overview
-
Understand and use scope7m 7s
-
2. PowerShell Advanced Functions
-
Specify usage for a function2m 31s
-
Create the function skeleton1m 28s
-
Test the completed function4m 25s
-
3. More Capabilities for Advanced Functions
-
4. Handle Errors
-
Handling errors29s
-
-
5. Debugging
-
Debug any errors33s
-
Debug with PSBreakpoints4m 43s
-
-
6. Format Custom Views
-
7. Script and Manifest Modules
-
8. Writing Help
-
Write help30s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Add a module-level setting variable