tis-powershell5

5.1-2
Windows Management Framework 5.1 including Powershell 5.1 for Windows 7
787 downloads
Download

  Description 

  • package : tis-powershell5
  • version : 5.1-2
  • architecture : all
  • categories : System and network
  • maintainer : WAPT Team,Hubert TOUVET,Jimmy PELÉ
  • description : Windows Management Framework 5.1 including Powershell 5.1 for Windows 7
  • locale :
  • target_os : windows
  • min_wapt_version : 1.5
  • sources : https://store.wapt.fr/store/tis-powershell5
  • installed_size :
  • impacted_process :
  • description_fr : Windows Management Framework 5.1 inclus Powershell 5.1 pour Windows 7
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Microsoft
  • licence : MIT
  • signature_date : 2020-02-27T21:39:42.102711
  • Homepage : https://docs.microsoft.com/powershell/
  • Depends :

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

#https://docs.microsoft.com/powershell/scripting/install/installing-windows-powershell
#https://www.microsoft.com/download/details.aspx?id=54616

# Declaring specific app values (TO CHANGE)
bin_name_win7_x64 = 'Win7AndW2K8R2-KB3191566-x64.msu'
bin_name_win7_x86 = 'Win7-KB3191566-x86.msu'
kb = 'KB3191566'


def is_kb_installed(hotfixid):
    installed_update = installed_windows_updates()
    if [kb for kb in installed_update if kb['HotFixID' ].upper() == hotfixid.upper()]:
        return True
    return False


def waiting_for_reboot():
    # Query WUAU from the registry
    if reg_key_exists(HKEY_LOCAL_MACHINE,'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\RebootRequired') or \
        reg_key_exists(HKEY_LOCAL_MACHINE,'SOFTWARE\\Microsoft\Windows\\CurrentVersion\\Component Based Servicing\\RebootPending') or \
        reg_key_exists(HKEY_LOCAL_MACHINE,'SOFTWARE\\Microsoft\\Updates\\UpdateExeVolatile'):
        return True
    return False


def install():
    print('installing %s' % control.asrequirement())
    with EnsureWUAUServRunning():
        if windows_version() > Version('6.1') and windows_version() < Version('6.2'):
            if not is_kb_installed(kb):
                if iswin64():
                    msu = bin_name_win7_x64
                else:
                    msu = bin_name_win7_x86
                run('wusa.exe "{}" /quiet /norestart'.format(msu),accept_returncodes=[0,3010,2359302],timeout=3600)
                print('reboot needed')
            else:
                print('{} already installed'.format(kb))

        if waiting_for_reboot():
            print('A reboot is needed !')


def uninstall():
    print('uninstalling %s' % control.asrequirement())

    if is_kb_installed (kb):
        run('wusa.exe /uninstall /kb:3191566 /quiet /norestart')


def update_package():
    print('Update package content from upstream binary sources')

    # Getting proxy informations from WAPT settings
    proxy = {}
    if isfile(makepath(application_data(),'waptconsole','waptconsole.ini')):
        proxywapt = inifile_readstring(makepath(user_local_appdata(),'waptconsole','waptconsole.ini'),'global','http_proxy')
        if proxywapt :
            proxy = {'http':proxywapt,'https':proxywapt}

    url_dl_w7_x64_zip = ('https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7AndW2K8R2-KB3191566-x64.zip')
    url_dl_w7_x86_zip = ('https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7-KB3191566-x86.zip')

    zip_name_win7_x64 = 'Win7AndW2K8R2-KB3191566-x64.zip'
    zip_name_win7_x86 = 'Win7-KB3191566-x86.zip'

    # Downloading binaries
    if not isfile(bin_name_win7_x64):
        print('Downloading ' + zip_name_win7_x64)
        wget(url_dl_w7_x64_zip,zip_name_win7_x64,proxies=proxy)
    if not isfile(bin_name_win7_x86):
        print('Downloading ' + zip_name_win7_x86)
        wget(url_dl_w7_x86_zip,zip_name_win7_x86,proxies=proxy)

    # Extracting
    sevenzip_path = makepath(programfiles,'7-Zip','7z.exe')

    for zip_in_dir in glob.glob('*.zip'):
        print('Extracting ' + zip_in_dir)
        run('"%s" x %s' % (sevenzip_path,zip_in_dir))
        remove_file('Install-WMF5.1.ps1')
        remove_file(zip_in_dir)


										

  Changelog 



https://www.microsoft.com/download/details.aspx?id=54616
									
  manifest.sha256