Azure-Samples / TestDeviceRegConnectivity

MIT License
27 stars 12 forks source link

not possible to call a method for an expression that has the NULL #2

Closed michaelulmer closed 2 years ago

michaelulmer commented 3 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

On a Win10 20H1 Machine in Powershell ISE (64bit) with the following restrictions:


PS C:\Windows\system32> Get-ExecutionPolicy -List
    Scope ExecutionPolicy
    ----- ---------------

MachinePolicy Undefined UserPolicy Undefined Process Unrestricted CurrentUser Unrestricted LocalMachine Unrestricted


### Any log messages given by the failure
>

PS C:\Windows\system32> C:\Users\TesterTest\Desktop\test-connection.ps1 It is not possible to call a method for an expression that has the NULL. In C:\Users\TesterTest\Desktop\test-connection.ps1:167 Zeichen:5

PowerShell is NOT running with elevated privileges

Recommended action: This test needs to be running with elevated privileges

Script completed successfully.



### Expected/desired behavior
>
Script works

### OS and Version?
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

### Versions
>

### Mention any other details that might be useful

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.
Apoc70 commented 2 years ago

Same issue here. The script fails because of New-ScheduledJobOption: The 'New-ScheduledJobOption' command was found in the module 'PSScheduledJob', but the module could not be loaded. For more information, run 'Import-Module PSScheduledJob'.