Configure floorplan (maps)

Hi everyone,

I’m currently trying to implement a floor plan using the instructions from this guide:

Setting up maps in Places.

When I try the first method where I simply import the IMDF file, I get the following error with this code:

powershell

Kopieren

New-Map -BuildingId xxx -FilePath "C:\Users\xxx\Downloads\Floorplans-IMDF.zip"

Error:

vbnet

Kopieren

WARNING: The map could not be imported. Please try again.
New-Map: Status(StatusCode="InvalidArgument", Detail="No levels were found correlated to directory floors for the building.")

As a result, I tried manually setting it up following the guide. However, I’m encountering an issue at step 5. When I attempt to correlate the IMDF file with the new CSV, I receive the following error:

powershell

Kopieren

PS C:\Users\xxx\Desktop\PowerShell 7.5> Import-MapCorrelations -MapFilePath C:\Users\xxx\Downloads\Floorplans-IMDF.zip -CorrelationsFilePath C:\Users\xxx\Downloads\mapfeatures.csv
INFO: Correlations file C:\Users\xxx\Downloads\mapfeatures.csv was provided. Adding the Places Directory Ids to the map data according to the correlations file...
INFO: No custom output file name provided, will write to imdf_correlated.zip.
Import-MapCorrelations: The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.

At this point, I’m not sure what I’m doing wrong. I’m following every step in the guide exactly as specified.

I would appreciate it if someone could help me out! I’m still relatively new to PowerShell.

Thanks in advance!

Do you receive this error everytime you try to run Import-MapCorrelations -MapFilePath C:\Users\xxx\Downloads\Floorplans-IMDF.zip -CorrelationsFilePath C:\Users\xxx\Downloads\mapfeatures.csv?

After you see the error in the terminal, can you run Get-Error or $error[0] | Select-Object * and share the full error output here.

Yes, evertime i run

Import-MapCorrelations -MapFilePath C:\Users\xxx\Downloads\Floorplans-IMDF.zip -CorrelationsFilePath C:\Users\xxx\Downloads\mapfeatures.csv

i get (full error output):

PS C:\Users\xxx\Desktop\PowerShell 7.5> Import-MapCorrelations -MapFilePath “C:\Users\xxx\Desktop\Floorplans-IMDF.zip” -CorrelationsFilePath “C:\Users\xxx\Desktop\mapfeatures.csv”
INFO: Correlations file C:\Users\xxx\Desktop\mapfeatures.csv was provided. Adding the Places Directory Ids to the map data according to the correlations file…
INFO: No custom output file name provided, will write to imdf_correlated.zip.
Import-MapCorrelations: The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.
PS C:\Users\xxx\Desktop\PowerShell 7.5> get-Error

Exception :
Type : System.Management.Automation.PSInvalidOperationException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread.
Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.
HResult : -2146233087
CategoryInfo : InvalidOperation: (:slight_smile: , ParentContainsErrorRecordException
FullyQualifiedErrorId : InvalidOperation
TargetSite :
Name : WriteHelper_ShouldWrite
DeclaringType : [System.Management.Automation.MshCommandRuntime]
MemberType : Method
Module : System.Management.Automation.dll
Message : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate
that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.
Source : System.Management.Automation
HResult : -2146233079
StackTrace :
at System.Management.Automation.MshCommandRuntime.WriteHelper_ShouldWrite(ActionPreference preference, ContinueStatus lastContinueStatus)
at System.Management.Automation.MshCommandRuntime.WriteVerbose(VerboseRecord record, Boolean overrideInquire)
at System.Management.Automation.Cmdlet.WriteVerbose(String text)
at MicrosoftPlaces.PlacesMaps.ImportMapCorrelations.ExecutePopulateImdfAsync()
at MicrosoftPlaces.PlacesMaps.ImportMapCorrelations.ExecuteCmdlet()
at MicrosoftPlaces.BasePSCmdlet.ProcessRecord()
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo : InvalidOperation: (:slight_smile: [Import-MapCorrelations], PSInvalidOperationException
FullyQualifiedErrorId : InvalidOperation,MicrosoftPlaces.PlacesMaps.ImportMapCorrelations
InvocationInfo :
MyCommand : Import-MapCorrelations
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 55
Line : Import-MapCorrelations -MapFilePath “C:\Users\xxx\Desktop\Floorplans-IMDF.zip” -CorrelationsFilePath “C:\Users\xxx\Desktop\mapfeatures.csv”
Statement : Import-MapCorrelations -MapFilePath “C:\Users\xxx\Desktop\Floorplans-IMDF.zip” -CorrelationsFilePath “C:\Users\xxxv\Desktop\mapfeatures.csv”
PositionMessage : At line:1 char:1
+ Import-MapCorrelations -MapFilePath "C:\Users\xxx\Desktop\ …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Import-MapCorrelations
CommandOrigin : Internal
ScriptStackTrace : at , : line 1

it’s helpful to use the “Preformatted Text” button when sharing any kind of code, even error code.
Or, in Markdown syntax, you can put three backticks ( ` ) on a line, paste your code, then put three more on their own line:

PS C:\Users\xxx\Desktop\PowerShell 7.5> get-Error

Exception :
Type : System.Management.Automation.PSInvalidOperationException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread.
Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.