Palli told the woman "the whole of the Bay of Plenty is under my control for the protection" and for his safety, the Government had given him firearms.
As he explained that, he lifted up the front of his shirt and exposed the two imitation firearms.
Judge Collin said Palli spent about half an hour at the victim's property. The victim was described as being frightened and upset.
Police later went to the Palli's house and found the two imitation firearms.
He told police he hid the "dummy guns" on him because he was going to sell them off", Judge Collin said.
The man's lawyer, Tim Braithwaite, applied for a discharge without conviction and name suppression for Palli but both applications were thrown out by Judge Collin.
Braithwaite told the judge Palli had conceded it was a "stupid mistake" and suggestions he was "going around presenting himself as an immigration officer on a regular basis" was not the case.
As a result of the charges, Braithwaite said Palli had lost his marriage and his business - which was a supplier of goods to retailers - and he was now suffering with mental health issues, including anxiety and depression.
Given the shame brought on him, especially within the Indian community, Palli would have no choice but to return to India if he was convicted and his name released, Braithwaite submitted.
Judge Collin said he recognised the offending had significantly impacted Palli's personal life but said those impacts were already in place and a conviction wouldn't change that.
Judge Collins said the offending had some "sinister undertones which I cannot ignore".
"I cannot be satisfied that a conviction entered will be out of proportion to his offending.
"Overall I am unwilling to conclude that a discharge would assist in the restoration of his reputation or his ability to re-establish contacts with those who have already deserted him because of what has occurred."
Name suppression on the basis it would cause extreme hardship to Palli was opposed by the police on the grounds it didn't meet the statutory threshold.
Judge Collin said there was a presumption that publication would occur and the hardship was a high threshold to be met and there needed to be compelling reasons.
"I accept that publication would be very distressing for Mr Palli and may cause him further grief. I am concerned about his mental health diagnosis."
However, Judge Collin said there was public interest in knowing the nature of the offending and he therefore declined the application.
As part of the sentence, Judge Collin also ordered Palli pay the victim a lump sum of $1500 within 21 days as reparation.