Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
382 views
in Technique[技术] by (71.8m points)

exception - Why am I getting this error in PowerShell even though the CMDpath I entered is correct?

I was trying these power forensics command from the powerforensics website the 1st two commands worked perfectly while the next 3 commands gave errors, I am sharing one of the errors below. Please tell me the solution to get rid of this error. enter image description hereWhat's wrong with the path of the cmd?

Command - PS C:> Get-ForensicFileRecord -Path C:Windowssystem32cmd.exe

Error: Get-ForensicFileRecord : Path C:Windowssystem32cmd.exe not found. At line:1 char:1

Get-ForensicFileRecord -Path C:Windowssystem32cmd.exe + CategoryInfo : NotSpecified: (:) [Get-ForensicFileRecord], Exception + FullyQualifiedErrorId : System.Exception,PowerForensics.Cmdlets.GetFileRecordCommand

link which I followed for this tutorial: https://powerforensics.readthedocs.io/en/latest/modulehelp/Get-ForensicFileRecord

PS: This command worked fine in one of my friend's machine but its throwing error for my machine.

question from:https://stackoverflow.com/questions/65934006/why-am-i-getting-this-error-in-powershell-even-though-the-cmdpath-i-entered-is-c

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You dont have the module installed in your system. It doesn't come by default.

So, what you need to do is below:

#To Find the module
Find-Module -Name *Forensic*

The Module name is actually PowerForensics. So, you can install it using:

Install-Module -Name PowerForensics

Press A, to Confirm All installation. Then,

#To Import the module
Import-Module PowerForensics

#To Get all the available commands in the module
Get-Command -Module PowerForensics

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...