Forum Discussion
bmidhun
1 year agoFrequent Visitor
Request for Guidance on Programmatically Generating PBIP Folder Structure Using C# or PowerShell
Hi Team We would like to request support or guidance on replicating the exact folder structure of a PBIP file programmatically, as outlined below: Report .Report/.pbi .Report/StaticReso...
- 1 year ago
Hi @bmidhun ,
we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,Chaithanya.
bmidhun
1 year agoFrequent Visitor
Kindly let me know if anyone have any idea on the above topic
v-kathullac
Community Support
1 year agoHi bmidhun ,
Thank you for reaching out to Microsoft Fabric Community Forum.
can you try the below code in powershell .
# Define the root directory for the PBIP project
$rootPath = "C:\PowerBIProject"
# Create the main folders
$reportPath = Join-Path $rootPath "Report"
$semanticModelPath = Join-Path $rootPath "SemanticModel"
$reportFolderPath = Join-Path $reportPath ".Report"
$staticResourcesPath = Join-Path $reportPath "StaticResources"
# Create the directories
New-Item -ItemType Directory -Path $reportFolderPath -Force
New-Item -ItemType Directory -Path $staticResourcesPath -Force
New-Item -ItemType Directory -Path $semanticModelPath -Force
# Create sample .pbi files and other platform files
New-Item -ItemType File -Path (Join-Path $reportFolderPath ".pbi") -Force
New-Item -ItemType File -Path (Join-Path $staticResourcesPath "placeholder.txt") -Force
New-Item -ItemType File -Path (Join-Path $reportPath "definition.pbir") -Force
New-Item -ItemType File -Path (Join-Path $reportPath "report.json") -Force
New-Item -ItemType File -Path (Join-Path $semanticModelPath ".pbi") -Force
New-Item -ItemType File -Path (Join-Path $semanticModelPath "definition") -Force
# Output success message
Write-Host "PBIP folder structure has been created at $rootPath"
Regards,
Chaithanya.