Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7091387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:10:44+00:00 2026-05-28T08:10:44+00:00

I have just downloaded the Register-TemporaryEvent cmdlet from http://poshcode.org/2205 and placed it in my

  • 0

I have just downloaded the Register-TemporaryEvent cmdlet from http://poshcode.org/2205 and placed it in my powershell profile directory near the $profile script.

How do I create a new command Register-TemporaryEvent which would be bound to this script?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:10:45+00:00Added an answer on May 28, 2026 at 8:10 am

    With PowerShell, you can execute scripts as commands if they are placed in directories contained in the ‘PATH’ environment variable. To see what directories are in the Path, you can use:

    $env:Path -split ';'| sort
    

    You could modify the path permanently from Windows’ System Properties to include the location of your scripts, or you could temporarily modify the path from within your profile or script. In your particular case, you could add the following to your profile to add the profile directory to the path:

    $ScriptRoot = Split-Path $SCRIPT:MyInvocation.MyCommand.Path
    
    if(($env:Path -split ';') -notcontains $ScriptRoot) {
        $env:Path += ';' + $ScriptRoot
    }
    

    You can then run the command as:

    PS >$timer = New-Object Timers.Timer
    PS >Register-TemporaryEvent $timer Disposed { [Console]::Beep(100,100) }
    

    Note: When tab completing, it will complete as Register-TemporaryEvent.ps1, but you can remove the ‘.ps1’ and it will still work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've just downloaded the Yahoo BOSS Mashup framework from http://developer.yahoo.com/search/boss/mashup.html , and I have
I have just downloaded SQL Server 2005 express edition from here: To be used
I have just downloaded and installed the VC++ 2010 Express tool from Microsoft. I
I have just downloaded a code from github and now would like to Fetch
I just downloaded the SWT examples from the Eclipse site but I have a
I have just downloaded an application from the android market. When I have installed
I have just downloaded the boost libraries from the boost website and extracted them
I have just downloaded the flexigrid and examples and tried to execute. In the
I'm new to Apex and have just downloaded Eclipse to get to work Eclipse
I have just downloaded and installed the 'facebook status' module and 'user feedback' module

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.