Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

pbiviz --create-cert error

Here is the details of my error:

C:\Users\nilotpal.datta\Documents\Power BI\Developer>pbiviz --create-cert
'powershell' is not recognized as an internal or external command,
operable program or batch file.
error Create certificate error: { Error: Command failed: powershell "$cert = ('Cert:\CurrentUser\My\' + ( New-SelfSignedCertificate -DnsName localhost -HashAlgorithm sha256 -Type Custom -Subject localhost -KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy Exportable -CertStoreLocation Cert:\CurrentUser\My -NotAfter (get-date).AddDays(180) | select Thumbprint | ForEach-Object { $_.Thumbprint.ToString() }).toString()); Export-PfxCertificate -Cert $cert -FilePath 'C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\certs\PowerBICustomVisualTest_public.pfx' -Password (ConvertTo-SecureString -String '7529797484684206' -Force -AsPlainText)"
'powershell' is not recognized as an internal or external command,
operable program or batch file.

at checkExecSyncError (child_process.js:616:11)
at execSync (child_process.js:653:13)
at createCertFile (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\bin\pbiviz.js:209:25)
at Command.<anonymous> (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\commander\index.js:395:35)
at Command.emit (events.js:189:13)
at Command.parseOptions (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\commander\index.js:702:14)
at Command.parse (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\commander\index.js:455:21)
at Object.<anonymous> (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\bin\pbiviz.js:60:9)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
status: 1,
signal: null,
output:
[ null,
<Buffer >,
<Buffer 27 70 6f 77 65 72 73 68 65 6c 6c 27 20 69 73 20 6e 6f 74 20 72 65 63 6f 67 6e 69 7a 65 64 20 61 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 6f 72 20 65 ... > ],
pid: 15324,
stdout: <Buffer >,
stderr:
<Buffer 27 70 6f 77 65 72 73 68 65 6c 6c 27 20 69 73 20 6e 6f 74 20 72 65 63 6f 67 6e 69 7a 65 64 20 61 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 6f 72 20 65 ... > }

C:\Users\nilotpal.datta\Documents\EY Badge\Power BI\Developer>services.msc
'services.msc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\nilotpal.datta\Documents\EY Badge\Power BI\Developer>pbiviz --create-cert
'powershell' is not recognized as an internal or external command,
operable program or batch file.
error Create certificate error: { Error: Command failed: powershell "$cert = ('Cert:\CurrentUser\My\' + ( New-SelfSignedCertificate -DnsName localhost -HashAlgorithm sha256 -Type Custom -Subject localhost -KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy Exportable -CertStoreLocation Cert:\CurrentUser\My -NotAfter (get-date).AddDays(180) | select Thumbprint | ForEach-Object { $_.Thumbprint.ToString() }).toString()); Export-PfxCertificate -Cert $cert -FilePath 'C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\certs\PowerBICustomVisualTest_public.pfx' -Password (ConvertTo-SecureString -String '35251793965561573' -Force -AsPlainText)"
'powershell' is not recognized as an internal or external command,
operable program or batch file.

at checkExecSyncError (child_process.js:616:11)
at execSync (child_process.js:653:13)
at createCertFile (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\bin\pbiviz.js:209:25)
at Command.<anonymous> (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\commander\index.js:395:35)
at Command.emit (events.js:189:13)
at Command.parseOptions (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\commander\index.js:702:14)
at Command.parse (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\commander\index.js:455:21)
at Object.<anonymous> (C:\Users\nilotpal.datta\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\bin\pbiviz.js:60:9)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
status: 1,
signal: null,
output:
[ null,
<Buffer >,
<Buffer 27 70 6f 77 65 72 73 68 65 6c 6c 27 20 69 73 20 6e 6f 74 20 72 65 63 6f 67 6e 69 7a 65 64 20 61 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 6f 72 20 65 ... > ],
pid: 1932,
stdout: <Buffer >,
stderr:
<Buffer 27 70 6f 77 65 72 73 68 65 6c 6c 27 20 69 73 20 6e 6f 74 20 72 65 63 6f 67 6e 69 7a 65 64 20 61 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 6f 72 20 65 ... > }

1 REPLY 1
v-evelk
Microsoft Employee
Microsoft Employee

Hello,

Please add the following to your Path environment variable:

 

%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
 
Kind regards,
 
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.