powershell.exe -ExecutionPolicy Bypass -File path\to\script.ps1
Yes, it really is that easy.
Ramblings about computers, Linux, and security
powershell.exe -ExecutionPolicy Bypass -File path\to\script.ps1
>>> import requests >>> r = requests.get('https://fullyqualifiedurl.com') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/site-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/usr/lib/python2.7/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 497, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
>>> import requests >>> r = requests.get('https://fullyqualifiedurl.com', verify=False) /usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:843: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)
>>> import requests >>> import urllib3 >>> urllib3.disable_warnings() >>> r = requests.get('https://fullyqualifiedurl.com', verify=False) >>> r.status_code 200
>>> import requests >>> from requests.packages import urllib3 >>> urllib3.disable_warnings() >>> r = requests.get('https://fullyqualifiedurl.com', verify=False) >>> r.status_code 200
try: import urllib3 except ImportError: from requests.packages import urllib3
powercfg.exe -H off
# yum -y install net-tools
> Get-ADDomainController -Filter * -server <domain> | Select-Object name, domain
> Get-ChildItem | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item
> Get-ChildItem -Recurse | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item
> Get-ChildItem -Recurse | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item -Recurse
> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 122
> (get-host).version Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 122