Problems with instalation gulp - visual-studio-code

I have a problem with instalation gulp for VScode.`
gulp : File C:\Users\Євгеній\AppData\Roaming\npm\gulp.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
+ gulp -v
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
`
Please help fix this issues
I am just start learning programming. My system Windows 10

Related

GCloud powershell commands throw error but works fine in cmd

When I run GCloud comannds via windows cmd prompt it works.
But when I run them via powershell it throws an error in red, but the command gets completed successfully.
Eg:
1) Auth
gcloud auth activate-service-account xxx#xxx-xxx.iam.gserviceaccount.com --key-file=C:\xxxxx\cred.json
Error:
python.exe : Activated service account credentials for: [xxxx#xxxx.iam.gserviceaccount.com]
At xxxxxxxxxxxx\gcloud.ps1:117 char:3
+ & "$cloudsdk_python" $run_args_array
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Activated servi...iceaccount.com]:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
2) Upload file to storage bucket
gsutil cp $outputFile gs://bucketxxx
Error:
gsutil : Copying file://N:\out\sqlserver\tag.csv [Content-Type=application/vnd.ms-excel]...
At xxxxxxx\RDS_SQLServer_ExportData_DataWarehouse.ps1:38 char:5
+ gsutil cp $outputFile gs://bucketxxx | out-null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Copying file://...nd.ms-excel]...:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
/ [0 files][ 0.0 B/ 2.8 MiB]
/ [1 files][ 2.8 MiB/ 2.8 MiB]
Operation completed over 1 objects/2.8 MiB.
I was not able comment, hence adding my inputs here.
First : The issue only seems to occur when this is run via Powershell ISE and not when executed via powershell prompt.
Second : This is not as such an error, for example when you see your own error you find the text after Not Specified as "Activated servi..." which means the action is sucessfully performed. Hope this helps to someone else stumbeling over here
python.exe : Activated service account credentials for: [xxxx#xxxx.iam.gserviceaccount.com]
At xxxxxxxxxxxx\gcloud.ps1:117 char:3
+ & "$cloudsdk_python" $run_args_array
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Activated servi...iceaccount.com]:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

Azure PowerShell will not connect

I have downloaded and installed the Azure Powershell by following the MS instructions:
https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/
Using the Windows Powershell ISE I run the command:
Login-AzureRmAccount
which returns the the error:
Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.Profile', but the module could not be loaded. For more information, run 'Import-Module AzureRM.Profile'. At line:1 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Import-Module AzureRM.Profile
Returns this error:
Import-Module : File C:\Program Files (x86)\Microsoft
SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile\CheckVersions.ps1 cannot be loaded
because running scripts is disabled on this system. For more information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module AzureRM.Profile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
Why is it so difficult to connect to Azure, what could be wrong?
From the command prompt run:
powershell Set-ExecutionPolicy RemoteSigned

Powershell, enable windows update error

I'm trying to configure windows update with the Microsoft.Update.AutoUpdate COM object with Powershell v4, on a Windows 2008 r2. I'm however running into a little trouble. When trying to set the NotificationLevel, I'm getting the following error (Note running with elevated permissions).
$WUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
$WUSettings.NotificationLevel=4
$WUSettings.save()
Output:
Exception setting "NotificationLevel": "Exception from HRESULT:
0x80240037" At line:1 char:1
+ $WUSettings.NotificationLevel=4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], SetValueInvocationException
+ FullyQualifiedErrorId : CatchFromBaseAdapterSetValueTI
Any help greatly appreciated!

Error to execute DSC when create virtual machine in azure

I create in powershell Virtual Machine Windows 8.1 in azure. And Set-Azure DSC. But I see error, during execute DSC:
[10/21/2014 14:17:39.44] Executing: C:\Packages\Plugins\Microsoft.Powershell.DSC\1.3.0.0\bin\install.cmd
[10/21/2014 14:17:47.24] Execution Complete.
#
Execution Output:
Execution Error:
C:\Packages\Plugins\Microsoft.Powershell.DSC\1.3.0.0\bin\install.ps1 : File
C:\Packages\Plugins\Microsoft.Powershell.DSC\1.3.0.0\bin\install.ps1 cannot be
loaded because running scripts is disabled on this system. For more
information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ C:\Packages\Plugins\Microsoft.Powershell.DSC\1.3.0.0\bin\install.ps1 -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
How can I enable security policy during create VM in powershell?

Unable to Use Windows Update COM object in RemotePS sessions

Im trying to change the windows update settings in a remote server using powershell, but when i run the below commands it gives me an error.
PS C:\Windows\system32> Enter-PSSession opalisbinary
[opalisbinary]: PS C:\Users\superv\Documents> $AUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
[opalisbinary]: PS C:\Users\superv\Documents> $AUSettings.NotificationLevel=2
Property 'NotificationLevel' cannot be found on this object; make sure it exists and is settable.
At line:1 char:14
+ $AUSettings. <<<< NotificationLevel=2
+ CategoryInfo : InvalidOperation: (NotificationLevel:String) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
[opalisbinary]: PS C:\Users\superv\Documents> $AUSettings.IncludeRecommendedUpdates=$true
Property 'IncludeRecommendedUpdates' cannot be found on this object; make sure it exists and is settable.
At line:1 char:14
+ $AUSettings. <<<< IncludeRecommendedUpdates=$true
+ CategoryInfo : InvalidOperation: (IncludeRecommendedUpdates:String) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
[opalisbinary]: PS C:\Users\superv\Documents> $AUSettings.Save()
You cannot call a method on a null-valued expression.
At line:1 char:18
+ $AUSettings.Save <<<< ()
+ CategoryInfo : InvalidOperation: (Save:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Although when i run it locally on the server it works fine...
Could anyone please help me.
Does it work when you connect via Remote desktop and run the commands? It also depends on the bittnes. I don't know the Microsoft.Update.AutoUpdate, so I'm just guessing, but - is it available for x64 version of PowerShell? In other words if you run it locally in x64 version and x86, do you see the errors?
I am sorry, I could not find a real answer. What I found is this link which states that remote PS sessions can be used with SCCM 2012, but they could not with SCCM 2007.
This does not help you, but it seems that not all COM objects are compatible with remote PS sessions.