What is my problem while inputting the script in Visual Studio Code - html

MY NODEMON IS NOT RUNNING. IT IS SHOWING nodemon : File C:\Users\Mahobano\AppData\Roaming\npm\nodemon.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ nodemon index.js
+ ~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
IN RESULT WHEN I INPUT nodemon index.js.

Due to security policies running scripts on vs code is disabled by default, and there is a lengthy process to change the policy to enable particular command, however, there is a shorter way to do that. just follow the below instructions:
Go to: C:\Users\Mahobano\AppData\Roaming\npm
Find nodemon.ps1
and delete this file and now nodemon will work on vs code

Related

json-server-auth not working when starting

i wanted to use json-server-auth but after installing it with npm it does not start.. I get this error:
json-server-auth : The term 'json-server-auth' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ json-server-auth db.json
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (json-server-auth:String) [], CommandNot
FoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Can someone tell me how to resolve this issue and start the json-server-auth because i need it for my angular application because i am learning authentication and i am stuck here because of this error..
Thank you
i used this command to start the server and it started without an issue:
json-server db.json -m ./node_modules/json-server-auth

problem with command template in visual studio code when trying to use mysql

I have downloaded and installed mysql extension on visual studio code and mysql server 2019. Now trying to access mysql via visual studio code cmd template. im using the command "mysql"and getting the following reply: ***mysql : The term 'mysql' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
mysql
+ CategoryInfo : ObjectNotFound: (mysql:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException***
Am i missing a step in the instillation process on Visual Studio? I am a beginner and help would be appreciated.

Getting "Specify which project file to use..." error when ef scaffolding

When I tried to execute scaffold command in PMC I am getting the following error :
dotnet ef dbcontext scaffold "server=127.0.0.1:3308;uid=root;pwd=root;database=newtest_db" MySql.EntityFrameworkCore -o MySQLDataOperations -f
dotnet : Specify which project file to use because this 'D:\Projects\DotNet5_Docker' contains more than one project file.
At line:1 char:1
dotnet ef dbcontext scaffold "server=127.0.0.1:3308;uid=root;pwd=root
CategoryInfo : NotSpecified: (Specify which p...e project file.:String) [], RemoteException
FullyQualifiedErrorId : NativeCommandError
Also executed by adding -p project name -s project name.
still repeating the same error.
Since this folder contains more than one projects and solution I have created a new project and tried the same then the error became below mentioned:
dotnet : Could not execute because the specified command or file was not found.
At line:1 char:1
dotnet ef dbcontext scaffold "server=127.0.0.1:3308;uid=root;pwd=root ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (Could not execu... was not found.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Possible reasons for this include:
You misspelled a built-in dotnet command.
You intended to execute a .NET program, but dotnet-ef does not exist.
You intended to run a
global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
I am using Visual Studio 2019. Tried the same in Powershell also. My intention is to implement data base first approach from an already existing MySQL data base using MySQL.Data.EntityframeworkCore
PMC Error for first project
PMC Error for another project

System.EnterpriseServies.Wrapper.dll missing in Powershell Work Flow

I run Server 2008 R2 as a workstation (mainly to get Hyper-V IIS 7.5). I’ve been playing around with this system for a while and it’s hardly pure! ;-)
Today, I loaded the latest set of patches, and took the reboot opportunity to add the rtm version of PowerShell v3. I duly removed the PowerShell V3 beta, applied the monthly patches, rebooted, then added the new version of PowerShell and rebooted again.
However, I now have an issue: Anytime I try to run a workflow, I get:
PSH [C:\foo]: Provision-AD # Run the workflow
The workflow ' Provision-AD ' could not be started: Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its
dependencies. An attempt was made to load a program with an incorrect format.
At line:321 char:21
+ throw (New-Object System.Management.Automation.ErrorRecord $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (System.Manageme...etersDictionary:PSBoundParametersDictionary) [], RuntimeException
+ FullyQualifiedErrorId : StartWorkflow.InvalidArgument
The solution was easy. I did a re-install of the .NET Framework 4.0 and all is now well!

Powershell script returns exception when using ADSI

I get exceptions when executing a Power shell script (v1.0) on Windows Server 2008 (32 bit).
It uses ADSI for searching a virtual directory before its deletion.
I get the following exception:
Exception calling "Find" with "2" argument(s): "Exception from HRESULT: 0x80005008"
At line:1 char:29
+ $iisMgr.psbase.children.find <<<< ("MyVirtualDir", $iisMgr.psbase.SchemaClassName)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
This is the code:
$vDirPath = "IIS://localhost/W3SVC/1/Root"
$iisMgr = [adsi]$vDirPath
$iisMgr.psbase.children.find("MyVirtualDir", $iisMgr.psbase.SchemaClassName)
(edit): from several blogs I read that the IIS6 Management Compatibility role service must be enabled to get the ADSI provider installed, and I already have it enabled, still having this exception...
Do you try with only one parameter ?
$iisMgr.psbase.children.find("MyVirtualDir")
I dont know there, but I've this kind of COM error when I invoke a method with the bad number of arguments.
JP
Just some ideas:
Do you authenticate when doing ADSI interaction?
I guess you are not making use of the Global Catalog as per your example of $vDirPath. In any case have a peek at See How to Modify Attributes That Replicate to the Global Catalog
Try running your Powershell session with elevated user rights (Right-Click Run As Administrator)