Can I add a specific file containing previous commands to my current session history in PowerShell using Add-History cmdlet? How? Answer according to: These commands add the commands typed in one PowerShell session to the history of a different PowerShell session.
This command adds the first five commands in the history to the end of the history list. It uses the Get-History cmdlet to get the five commands ending in command 5. The pipeline operator passes them to the Add-History cmdlet, which appends them to the current history. The Add-History command does not include any parameters, but PowerShell associates the objects passed through the pipeline with the InputObject parameter of Add-History.
This command adds the commands in the History01.xml file to the current session history. It uses the InputObject parameter to pass the results of the command in parentheses to the Add-History cmdlet. The command in parentheses, which is executed first, imports the History01.xml file into PowerShell. The Add-History cmdlet then adds the commands in the file to the session history.
To specify the commands to add to the history, use the InputObject parameter. The Add-History command accepts only HistoryInfo objects, such as those returned for each command by the Get-History cmdlet. You cannot pass it a path and file name or a list of commands.
You can use the InputObject parameter to pass a file of HistoryInfo objects to Add-History. To do so, export the results of a Get-History command to a file by using the Export-Csv or Export-Clixml cmdlet and then import the file by using the Import-Csv or Import-Clixml cmdlets. You can then pass the file of imported HistoryInfo objects to Add-History through a pipeline or in a variable. For more information, see the examples.
The file of HistoryInfo objects that you pass to the Add-History cmdlet must include the type information, column headings, and all of the properties of the HistoryInfo objects. If you intend to pass the objects back to Add-History, do not use the NoTypeInformation parameter of the Export-Csv cmdlet and do not delete the type information, column headings, or any fields in the file.
To modify the session history, export the session to a CSV or XML file, modify the file, import the file, and use Add-History to append it to the current session history.
This prompt doesn't seem malicious.