[Bug]: VerbosePreference property not found on this object
What happened?
Originally posted by @roohfelix
Hi everyone,
I'm currently using Monkey365 (v0.95.1) to run a Microsoft 365 security assessment. I'm executing a collection that includes AdminPortal, ExchangeOnline, MicrosoftTeams, and SharePointOnline (Purview was excluded due to connection issues).
However, when I run the following:
$options = @{ Instance = 'Microsoft365'; Collect = @('AdminPortal','ExchangeOnline','MicrosoftTeams','SharePointOnline'); PromptBehavior = 'SelectAccount'; IncludeEntraID = $true; ExportTo = @('CSV', 'HTML'); WriteLog = $true; } Invoke-Monkey365 @options
I get this error:
Write-Error : [Invoke-M365Scanner] - Unable to create var object: The property 'VerbosePreference' was not found on this object. Verify that the property exists. At C:\Monkey365\core\tasks\Initialize-MonkeyScan.ps1:99 char:13
throw ("{0}: {1}" -f "Unable to create var object",$_.Exception.Message) Has anyone run into this issue?
Thanks in advance to anyone who can share insights or confirm the best approach.
Hey all I can confirm that it's a bug and only appears when the -Verbose option is not set. I'll add this as a new issue.
In the meantime you can use the following:
$options = @{
Instance = 'Microsoft365';
Collect = @('AdminPortal','ExchangeOnline','MicrosoftTeams','SharePointOnline');
PromptBehavior = 'SelectAccount';
IncludeEntraID = $true;
ExportTo = @('CSV', 'HTML');
WriteLog = $true;
Verbose = $true;
Debug = $true;
}
Invoke-Monkey365 @options
Could you please let me know if the above works for you?
Thanks for catching this @roohfelix! It's really appreciated.
Cheers,
@silverhack I also encountered the problem and can confirm it is fixed in the dev branch (0.95.2).
Thanks mate! I'll then update the main branch shortly.
Cheers
Hi all,
Main branch was updated, and a new release was published to the PowerShell Gallery.
Thank you all for your support. It's really appreciated.
This issue has been automatically marked as stale because it has not had recent activity. We kindly ask you to check again if the issue you reported is still relevant in the current version of Monkey365. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.
This issue was closed because it has been inactive for 14 days since being marked as stale. If the issue is still relevant, feel free to re-open it or open a new one.