t3chb0t
t3chb0t

Reputation: 18636

Call cmdlet directly without loading it via $profile

I created a cmdlet *.ps1 file with a single function Backup-Data that I load into my $profile with Import-Module Backup-Data.ps1.

Everytime I test it, I save the file and reopen the powershell console but this process is very tedious. So, I was wondering whether there is a way to call that directly from the console?

Upvotes: 0

Views: 59

Answers (1)

Mathias R. Jessen
Mathias R. Jessen

Reputation: 174445

Unless you're defining new types in the Backup-Data.ps1 script, the following should suffice for restarting your testing in an interactive session:

Remove-Module Backup-Data -Force
Import-Module Backup-Data.ps1

Upvotes: 1

Related Questions