I'm doing the Service Fabric tutorial that can be found here:
https://azure.microsoft.com/en-us/documentation/articles/service-fabric-create-your-first-application-in-visual-studio/
I started PowerShell (in Windows 10 running in Parallels through OS X) as administrator an executed this according to instructions:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser
I have started Visual Studio 2015 both as admin and normally. I then started the tutorial app, but I'm getting the following error:
The PowerShell script failed to execute. See the Output window for details.
The output window just gives this:
2>Finished executing script 'Set-LocalClusterReady'.
2>Time elapsed: 00:00:03.1922793
2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Any ideas to what could be wrong?
UPDATE: I actually get the following error:
2>EnsureAdminPrivileges : Not running as administrator. You need to run Visual Studio with administrator privileges
Which is strange because I have started VS as administrator...
In my case, the solution was that I first needed to close Visual Studio and the run it as an administrator.
Very simple solution to an annoying error.
I had this error in VS17 RC as well as Unable to determine whether the application is installed on the cluster or not. It seemed as if the deployment of the local cluster had some issues.
What solved it for me was to run Repair from the Visual Studio setup.
After repairing, the cluster deployed as expected and I had no more error messages.
Related
I have a problem related to MSFT_RoleResource, I have recovered a DSC script that you can find below:
The compilation in .mof works as shown below:
Once the compilation is finished I want to make an Azure policy, the compilation works as shown below ( it's very strange because when i compile the script i have error who say replace the PSDesiredStateConfiguration By PSDresource):
I want to test it afterwards but it sends me this error:
Can you help me?
Thank you so much
I tried to redo the manipulation on a blank machine, uninstall Powershell 7 and reinstall .
We are getting the below error while running the command "minikube start --driver=hyperv" which was initially working properly but suddenly started giving an error.
C:\Windows\system32>minikube start --driver=hyperv
minikube v1.22.0 on Microsoft Windows 10 Enterprise 10.0.19043 Build 19043
Using the hyperv driver based on user configuration
Exiting due to PROVIDER_HYPERV_NOT_FOUND: The 'hyperv' provider was not found: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive #(Get-Wmiobject Win32_ComputerSystem).HypervisorPresent returned "False\r\n"
Suggestion: Enable Hyper-V: Start PowerShell as Administrator, and run: 'Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All'
Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/hyperv/
We tried to disabled and enabled the "hyperv" from the Windows Features tab and then restarted the machine but it didn't work.
When we hit a command "systeminfo" we got the below, saying "hyperv" is enabled.
Hyper-V Requirements:
VM Monitor Mode Extensions: Yes
Virtualization Enabled In Firmware: Yes
Second Level Address Translation: Yes
Data Execution Prevention Available: Yes
Now we have enabled the "hyperv", restarted the machine but still we are getting the error, could anyone please help us out in this?
Thanks in advance!!!
Reason: missing powershell.exe path
Resolution: Add C:\Windows\System32\WindowsPowerShell\v1.0 into Environmental Variables... > System variables > Path
Here is what I did - I'm not sure which part fixed it
bcdedit /set hypervisorlaunchtype auto
Followed this answer
powershell -version 5
minikube start --vm-driver hyperv ...
Please follow this page Hopefully it will fix your problem. we need to install dependencies first.
https://minikube.sigs.k8s.io/docs/drivers/
https://medium.com/#JockDaRock/minikube-on-windows-10-with-hyper-v-6ef0f4dc158c
if you are using docker desktop then switch to linux containers and the run minikube start
I am doing local Chef dev on my Windows 8.1 laptop and use VirtualBox 5.1.24 for VMs. I want to use Jenkins (v2.73.2) to run jobs that will automate the restoring of VM snapshots and running of kitchen converge, test and repeat.
I have added the VirtualBox Plugin but it doesn't let me add a node (I recall seeing somewhere that v2.73.2 of Jenkins is not supported).
I wrote some Powershell to do what I want and so after installing PowerShell Plugin created a pipeline with following PowerShell to test it:
& "C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" startvm "W2008_21_06_B"
(which works in PS ISE), but fails in Jenkins job:
Building on master in workspace C:\Program Files (x86)\Jenkins\workspace\vbox
[vbox] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\windows\TEMP\jenkins7025720492184266246.ps1'"
vboxmanage.exe: error: Could not find a registered machine named 'W2008_21_06_B'
vboxmanage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown
vboxmanage.exe: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 573 of file VBoxManageMisc.cpp
Build step 'Windows PowerShell' marked build as failure
Finished: FAILURE
What trick am I missing please?
Regards
I am trying to run a PowerShell script that a colleague wrote and deployed to run as an SSIS package. He is able to run the script successfully within Visual Studio and it runs fine from the SQL Agent scheduler.
When I run the script - indeed, any PowerShell script - from an Execute Process task in Visual Studio, I get the same exit error code:
The process exit code was "-1073741790" while the expected was "0".
As far as we can both tell, our development environments are almost identical.
Wondering if anyone has any insight or advice on how to debug and resolve.
Cheers,
Chris
This sounds like a security or trust issue. Please relax the powershell permissions on your system and then check again. You can do this by running this command:
Set-ExecutionPolicy Unrestricted
That will determine if this is indeed an execution policy or something different and you can move on from there by changing the execution policy setting permanently, ad-hoc or by creating signed scripts.
Using the Set-ExecutionPolicy Cmdlet
One of my jobs had need for the ConvertTo-Json commandlet available in powershell 3.0 So I installed WMF 3.0 on our Windows Server 2008 R2 (SP1) box. After a restart all my powershell using jobs result in the error:
[workspace] $ powershell.exe "& 'C:\Users\HUDSON~1\AppData\Local\Temp\hudson1263303013566726397.ps1'"
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "powershell.exe" (in directory "C:\hudson\jobs\MyProject\workspace"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:192)
at hudson.Proc$LocalProc.<init>(Proc.java:164)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:639)
at hudson.Launcher$ProcStarter.start(Launcher.java:274)
at hudson.Launcher$ProcStarter.join(Launcher.java:281)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:84)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:60)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
at hudson.model.Build$RunnerImpl.build(Build.java:175)
at hudson.model.Build$RunnerImpl.doRun(Build.java:137)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
at hudson.model.Run.run(Run.java:1366)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:188)
at java.lang.ProcessImpl.start(ProcessImpl.java:132)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 16 more
Running powershell.exe from the cmd prompt works just fine.
What happened? How do I fix this?
I am using the Powershell Plugin to launch the scripts and I cannot find any configuration area for it.
After a day's worth of hassle we found the answer. We're still not sure exactly why it happened but the powershell directory disappeared from Hudson's path. Then, although PS3 was installed and the machine had been restarted, Hudson for some reason had not picked up the new PATH variable.
Manually shutting down and restarting Hudson finally got it to pick up the correct PATH and fixed the issue.
George:
I had the exact same problem with the Task Scheduler, right after installing PowerShell 3.0. Running simply "powershell" or "powershell.exe" as a Scheduled Task failed. Rebooting the machine fixed it (I couldn't just restart the Task Scheduler on Windows Server 2008 R2).
My guess is what's happening is that after the reboot when installing PS 3.0, the path is set, and by that time all of your automatic services (like Task Scheduler or Hudson) have started.
So let this be a warning to friend and foe alike. When you install PowerShell 3.0, reboot twice!